Skip to content

Instantly share code, notes, and snippets.

@NathanWalker
Last active June 30, 2022 04:08
Show Gist options
  • Save NathanWalker/d1a06cbd4a21fb12e076a4bbb97d57bd to your computer and use it in GitHub Desktop.
Save NathanWalker/d1a06cbd4a21fb12e076a4bbb97d57bd to your computer and use it in GitHub Desktop.
NativeScript for Angular bootstrap
import {
platformNativeScript,
runNativeScriptAngularApp,
} from "@nativescript/angular";
import { AppModule } from "./app/app.module";
// runs the NativeScript application, nothing is bootstrapped yet, as we're only setting up the platform and callbacks
runNativeScriptAngularApp({
// this function will be called when we need to display the application UI
// a major difference from the web is that this module may be destroyed when the user leaves the application and recreated when the user opens it again
// so remember to implement all the needed ngOnDestroy to cleanup any events that were bound here!
appModuleBootstrap: () => platformNativeScript().bootstrapModule(AppModule),
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment