Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c113721

Browse files
committedJan 6, 2019
refactor(HMR): module hot accept callback
1 parent 5c94637 commit c113721

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
 

‎demo/AngularApp/app/main.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ if (module["hot"]) {
1414
},
1515
}
1616

17-
// Path to your app module.
18-
// You might have to change it if your module is in a different place.
19-
module["hot"].accept(["./app.module"], global["__hmrRefresh"]);
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+
});
2022
}
2123

22-
// A traditional NativeScript application starts by initializing global objects, setting up global CSS rules, creating, and navigating to the main page.
23-
// Angular applications need to take care of their own initialization: modules, components, directives, routes, DI providers.
24-
// A NativeScript Angular app needs to make both paradigms work together, so we provide a wrapper platform object, platformNativeScriptDynamic,
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,
2527
// that sets up a NativeScript application and can bootstrap the Angular framework.
2628
platformNativeScriptDynamic(options).bootstrapModule(AppModule);

0 commit comments

Comments
 (0)
This repository has been archived.