Add a simple polyfil for System.import so we can use some Angular services out-of-the-box (#5042)

This commit is contained in:
Panayot Cankov
2017-11-07 14:59:36 +02:00
committed by GitHub
parent 65a50bbf82
commit 011be368b1

View File

@@ -70,6 +70,18 @@ global.registerModule("ui/dialogs", () => require("ui/dialogs"));
global.registerModule("xhr", () => require("xhr"));
global.registerModule("fetch", () => require("fetch"));
(<any>global).System = {
import(path) {
return new Promise((resolve, reject) => {
try {
resolve(global.require(path));
} catch(e) {
reject(e);
}
});
}
}
const __tnsGlobalMergedModules = new Map<string, boolean>();
function registerOnGlobalContext(name: string, module: string): void {