angularjs - TypeScript and Angular - when to use a module vs an IIFE -
i'm starting out using typescript angular. looking through sample applications, , see .js
starts iife, while other times file starts module declaration.
can explain when 1 of these should used on other?
when write module in typescript:
module mymodule { export class example { } }
the result invoked function expression:
var mymodule; (function (mymodule) { var example = (function () { function example() { } return example; })(); mymodule.example = example; })(mymodule || (mymodule = {}));
so can use modules in typescript make code less noisy.
Comments
Post a Comment