-
-
Save nikhilk/4660121 to your computer and use it in GitHub Desktop.
Using script# generated AMD module w/o AMD require + getting VS intellisense.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// equivalent of ss.module ... inlined here for a sample | |
function module(name, obj) { | |
var x = {}; | |
x[name] = obj; | |
return x; | |
} | |
// generated module | |
(function($global) { | |
// assume this is some public type | |
function xyz(param) { | |
} | |
var $exports = module('xyz', xyz); | |
// Add this line in your script template - this exports | |
// a module to global scope (required since you're not using | |
// the rest of the AMD infrastructure - require) ... | |
// though I'd suggest you look into using it if you can. | |
$global.foo = $exports; | |
})(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// other manually authored script where you want intellisense | |
/// <reference path="A.js" /> | |
// You should see xyz listed on the '.' | |
foo.xyz(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment