@@ -18,7 +18,7 @@ class FirstComponent { }
1818 directives : [ ROUTER_DIRECTIVES , NS_ROUTER_DIRECTIVES ] ,
1919 styleUrls : [ "examples/navigation/router-outlet-test.css" ] ,
2020 template : `
21- <StackLayout>
21+ <StackLayout #secondStack (loaded)="onLoaded(secondStack)" >
2222 <Label [text]="'Second component - ' + id" class="title"></Label>
2323 </StackLayout>`
2424} )
@@ -27,6 +27,10 @@ class SecondComponent {
2727 constructor ( routeParams : RouteParams ) {
2828 this . id = routeParams . get ( "id" ) ;
2929 }
30+
31+ onLoaded ( args ) {
32+ console . log ( "==========>>>>>>>>>>>>>SecondComponent loaded event with args: " + args ) ;
33+ }
3034}
3135
3236@Component ( {
@@ -35,7 +39,7 @@ class SecondComponent {
3539 styleUrls : [ "examples/navigation/router-outlet-test.css" ] ,
3640 template : `
3741 <StackLayout>
38- <StackLayout class="nav">
42+ <StackLayout #stack class="nav" (loaded)="onLoaded(stack) ">
3943 <Button text="First" [nsRouterLink]="['First']"></Button>
4044 <Button text="GO(1)" [nsRouterLink]="['Second', { id: 1 }]"></Button>
4145 <Button text="GO(2)" [nsRouterLink]="['Second', { id: 2 }]"></Button>
@@ -50,4 +54,8 @@ class SecondComponent {
5054 { path : '/first' , component : FirstComponent , name : 'First' , useAsDefault : true } ,
5155 { path : '/second/:id' , component : SecondComponent , name : 'Second' } ,
5256] )
53- export class RouterOutletTest { }
57+ export class RouterOutletTest {
58+ onLoaded ( args ) {
59+ console . log ( "==========>>>>>>>>>>>>>RouterOutletTest loaded event with args: " + args ) ;
60+ }
61+ }
0 commit comments