@@ -14,8 +14,8 @@ import { Page } from "ui/page";
1414 <StackLayout>
1515 <Label text="First component" class="title"></Label>
1616 <StackLayout class="nav">
17- <Button class="link" text="Start" nsRouterLink="/ second/1 "></Button>
18- <Button class="link" text="Detail" nsRouterLink="/ second/1/ detail/3 "></Button>
17+ <Button class="link" text="Start" [ nsRouterLink]="[' second','1'] "></Button>
18+ <Button class="link" text="Detail" [ nsRouterLink]="[' second','1',' detail','3'] "></Button>
1919 </StackLayout>
2020 </StackLayout>`
2121} )
@@ -43,7 +43,7 @@ class FirstComponent implements OnInit, OnDestroy {
4343 <StackLayout class="master">
4444 <Label text="Master View" class="subtitle"></Label>
4545
46- <Button *ngFor="let detail of details" [text]="'Detail ' + detail" [nsRouterLink]="['../ detail', detail]"></Button>
46+ <Button *ngFor="let detail of details" [text]="'Detail ' + detail" [nsRouterLink]="['detail', detail]"></Button>
4747 </StackLayout>
4848 `
4949} )
@@ -87,7 +87,7 @@ class DetailComponent {
8787
8888 <StackLayout class="nav">
8989 <Button class="link" text="< BACK" (tap)="goBack()"></Button>
90- <Button class="link" [text]="'Second ' + (nextDepth$ | async) + ' >'" [nsRouterLink]="['../ ', (nextDepth$ | async)]"></Button>
90+ <Button class="link" [text]="'Second ' + (nextDepth$ | async) + ' >'" [nsRouterLink]="['/second ', (nextDepth$ | async)]"></Button>
9191 </StackLayout>
9292
9393 <router-outlet></router-outlet>
@@ -132,14 +132,12 @@ export class PageRouterOutletNestedAppComponent {
132132
133133
134134const routes : RouterConfig = [
135- { path : "/first" , component : FirstComponent } ,
136- { path : "/" , redirectTo : "/first" , terminal : true } ,
135+ { path : "" , component : FirstComponent } ,
137136 {
138- path : "/ second/:depth" , component : SecondComponent ,
137+ path : "second/:depth" , component : SecondComponent ,
139138 children : [
140- { path : "/" , redirectTo : "master" , terminal : true } ,
141- { path : "/master" , component : MasterComponent } ,
142- { path : "/detail/:id" , component : DetailComponent }
139+ { path : "" , component : MasterComponent } ,
140+ { path : "detail/:id" , component : DetailComponent }
143141 ]
144142 } ,
145143] ;
0 commit comments