Posts

Showing posts with the label calling-convention

How to invoke a javascript function (generated from typescript) trapped within “System.register()” module?

How to invoke a javascript function (generated from typescript) trapped within “System.register()” module? We have moved our application from Javascript to Typescript for obvious advantages of OOP etc.. Earlier invoking a direct javascript function from Html was as straight forward as: window.MyFunction() Now with Typescript, all the files are combined into a single autogenerated .js file. In this single file, individual code of every file are isolated within System.register() . It typically looks something like: System.register() System.register("<filename>", ["<import_1>", ..., "<import_N>"], function (exports_13, context_13) { "use strict"; ... function MyFunction () { ... } // somewhere inside the external function } In short, everything is wrapped in an unnamed function, written within the .ts file. Now, I don't know how to invoke a function, which is trapped inside another function, which is in turn listed under ...