Skip to content

Instantly share code, notes, and snippets.

@diverted247
Created December 13, 2012 14:09
Show Gist options
  • Save diverted247/4276598 to your computer and use it in GitHub Desktop.
Save diverted247/4276598 to your computer and use it in GitHub Desktop.
TypeScript - Modules: Module syntax results in JS Closure with private properties. compile: tsc --module AMD M.ts
module M {
var s = "hello";
export function f() {
return s;
}
}
@diverted247
Copy link
Author

var M;
(function (M) {
    var s = "hello";
    function f() {
        return s;
    }
    M.f = f;
})(M || (M = {}));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment