Angular 2如何使用可选参数导航到子路由

时间:2017-09-03 12:40:15

标签: angular angular2-routing angular2-template

嗨,我正在打开孩子的“添加体验”。查看父母' my-account'这与

工作正常
<button type="button" [routerLink]="['/my-account', {outlets: {'editDetail':['add-experience']}}]" class="btn btn-primary relative waves-light" (click)="basicModal.show()" mdbRippleRadius>add experience</button>

现在我想传递像孩子的ID这样的参数&#39; add-experience&#39; 请告诉我怎么做?

{ path: 'my-account',  component: MyAccountComponent, canActivate:[AuthService],
  children:[
      { path: 'add-experience', component: AddExperienceComponent, 
        canActivate:[AuthService], outlet: 'editDetail',

            children:[
                 {path: ':id', component: AddExperienceComponent, 
                  canActivate:[AuthService], outlet: 'editDetail'}
      ] }
    ]
  }

0 个答案:

没有答案