From 4a34926920973e6c3b3043573a3bfc1544a65460 Mon Sep 17 00:00:00 2001 From: Panayot Cankov Date: Mon, 18 Dec 2017 16:11:26 +0200 Subject: [PATCH] refactor(angular5): Declare the app.module.ngfactory.d.ts generated by ngc with AoT The angular compiler will generate dynamically the app.module.ngfactory.d.ts. For plain tsc to compile without errors the main.aot.ts should be compiled without errors, so app.module.ngfactory.d.ts will provide the necessary type information. --- demo/AngularApp/app/app.module.ngfactory.d.ts | 4 ++++ demo/AngularApp/app/main.aot.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 demo/AngularApp/app/app.module.ngfactory.d.ts diff --git a/demo/AngularApp/app/app.module.ngfactory.d.ts b/demo/AngularApp/app/app.module.ngfactory.d.ts new file mode 100644 index 00000000..793157de --- /dev/null +++ b/demo/AngularApp/app/app.module.ngfactory.d.ts @@ -0,0 +1,4 @@ +/** + * A dynamically generated module when compiled with AoT. + */ +export const AppModuleNgFactory: any; \ No newline at end of file diff --git a/demo/AngularApp/app/main.aot.ts b/demo/AngularApp/app/main.aot.ts index 3abe1e5f..d5ff77a7 100644 --- a/demo/AngularApp/app/main.aot.ts +++ b/demo/AngularApp/app/main.aot.ts @@ -2,6 +2,6 @@ import { platformNativeScript } from "nativescript-angular/platform-static"; // "./app.module.ngfactory" is a dynamically generated module when compiled with AoT. -const { AppModuleNgFactory } = require("./app.module.ngfactory"); +import { AppModuleNgFactory } from "./app.module.ngfactory"; platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory);