1+ import { TestApp , registerTestApp } from "../../tests/test-app" ;
2+ import { ApplicationRef } from '@angular/core' ;
13// >> router-outlet-example
2- import { Component } from '@angular/core' ;
3- import { nativeScriptBootstrap } from 'nativescript-angular/application' ;
4- import { ROUTER_DIRECTIVES , Router } from '@angular/router' ;
5- import { NS_ROUTER_DIRECTIVES } from 'nativescript-angular/router' ;
6-
7- import { APP_ROUTER_PROVIDERS } from "./app.routes" ;
4+ import { Component , NgModule } from '@angular/core' ;
5+ import { platformNativeScriptDynamic } from "nativescript-angular/platform" ;
6+ import { NativeScriptRouterModule } from "nativescript-angular/router" ;
7+ import { Router } from '@angular/router' ;
8+ import { routes } from "./app.routes" ;
89
910@Component ( {
1011 selector : 'navigation-test' ,
11- directives : [ ROUTER_DIRECTIVES , NS_ROUTER_DIRECTIVES ] ,
1212 template : `
1313 <StackLayout>
1414 <StackLayout class="nav">
@@ -24,15 +24,26 @@ import {APP_ROUTER_PROVIDERS} from "./app.routes";
2424} )
2525export class NavigationApp {
2626 // >> (hide)
27- constructor ( public router : Router ) { }
27+ constructor ( public router : Router , public appRef : ApplicationRef ) {
28+ registerTestApp ( NavigationApp , this , appRef ) ;
29+ }
2830 // << (hide)
2931}
3032
33+ @NgModule ( {
34+ bootstrap : [ NavigationApp ] ,
35+ imports : [
36+ NativeScriptRouterModule ,
37+ NativeScriptRouterModule . forRoot ( routes )
38+ ]
39+ } )
40+ export class NavigationAppModule { }
41+
3142// >> (hide)
3243function start_snippet ( ) {
3344// << (hide)
34- nativeScriptBootstrap ( NavigationApp , [ APP_ROUTER_PROVIDERS ] ) ;
45+ platformNativeScriptDynamic ( ) . bootstrapModule ( NavigationAppModule ) ;
3546// >> (hide)
3647}
3748// << (hide)
38- // << router-outlet-example
49+ // << router-outlet-example
0 commit comments