Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 7d04761

Browse files
author
vakrilov
committed
chore: update apps
1 parent b1d4ecc commit 7d04761

File tree

6 files changed

+6
-27
lines changed

6 files changed

+6
-27
lines changed

demo/AngularApp/app/main.ts

+1-24
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,5 @@
11
// this import should be first in order to load some required settings (like globals and reflect-metadata)
22
import { platformNativeScriptDynamic } from "nativescript-angular/platform";
3-
import { AppOptions } from "nativescript-angular/platform-common";
4-
53
import { AppModule } from "./app.module";
64

7-
let options: AppOptions = {};
8-
9-
if (module["hot"]) {
10-
options.hmrOptions = {
11-
moduleTypeFactory: () => AppModule,
12-
livesyncCallback: (platformReboot) => {
13-
setTimeout(platformReboot, 0);
14-
},
15-
}
16-
17-
module["hot"].accept(["./app.module"], () => {
18-
// Currently the context is needed only for application style modules.
19-
const moduleContext = {};
20-
global["hmrRefresh"](moduleContext);
21-
});
22-
}
23-
24-
// A traditional NativeScript application starts by initializing global objects, setting up global CSS rules, creating, and navigating to the main page.
25-
// Angular applications need to take care of their own initialization: modules, components, directives, routes, DI providers.
26-
// A NativeScript Angular app needs to make both paradigms work together, so we provide a wrapper platform object, platformNativeScriptDynamic,
27-
// that sets up a NativeScript application and can bootstrap the Angular framework.
28-
platformNativeScriptDynamic(options).bootstrapModule(AppModule);
5+
platformNativeScriptDynamic().bootstrapModule(AppModule);

demo/AngularApp/webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = env => {
6262
const tsConfigName = "tsconfig.tns.json";
6363
const entryModule = `${nsWebpack.getEntryModule(appFullPath, platform)}.ts`;
6464
const entryPath = `.${sep}${entryModule}`;
65-
const entries = { bundle: entryPath };
65+
const entries = { bundle: entryPath, application: "./application.android" };
6666
const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some(e => e.indexOf("tns-core-modules") > -1);
6767
if (platform === "ios" && !areCoreModulesExternal) {
6868
entries["tns_modules/tns-core-modules/inspector_modules"] = "inspector_modules";

demo/JavaScriptApp/app/app-root.xml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<Frame defaultPage="main-page" />

demo/JavaScriptApp/app/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ purpose of the file is to pass control to the app’s first module.
66

77
var application = require("tns-core-modules/application");
88

9-
application.start({ moduleName: "main-page" });
9+
application.run({ moduleName: "app-root" });
1010

1111
/*
1212
Do not place any code after the application has been started as it will not

demo/TypeScriptApp/app/app-root.xml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<Frame defaultPage="main-page" />

demo/TypeScriptApp/app/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ purpose of the file is to pass control to the app’s first module.
66

77
import * as app from 'tns-core-modules/application';
88

9-
app.start({ moduleName: 'main-page' });
9+
app.run({ moduleName: "app-root" });
1010

1111
/*
1212
Do not place any code after the application has been started as it will not

0 commit comments

Comments
 (0)