Passing Multiple route params in Angular2

前端 未结 4 1424
耶瑟儿~
耶瑟儿~ 2021-01-31 00:51

Is it possible to pass multiple route params e.g. like below need to pass id1 and id2 to the component B

@RouteConfig([
           


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-31 01:54

          new AsyncRoute({path: '/demo/:demoKey1/:demoKey2', loader: () => {
          return System.import('app/modules/demo/demo').then(m =>m.demoComponent);
           }, name: 'demoPage'}),
           export class demoComponent {
           onClick(){
                this._router.navigate( ['/demoPage', {demoKey1: "123", demoKey2: "234"}]);
              }
            }
    

提交回复
热议问题