Angular 2 - 嵌套路由

时间:2017-02-01 13:29:20

标签: angular routing

我是角度2的初学者,我正在尝试做一些路由练习。我在productDetailComponent上有一个按钮。现在当我点击按钮时,它希望页面路由到moreDetailComponent。

dbx <PATHTOBINARY>/binaryfile

//按钮移动到页面(moreDetailsComponent)

export const TutorialRoutes: Routes =[
i w
  {
    path: 'Company',

    component: CompanyComponent,
    children: [
      {path: '', redirectTo: 'people'},
      {path: 'price', component: PriceComponent},

        {path: 'products', component: ProductComponent,

        children:[

            {path: '', redirectTo:'product-details'},
            {path:'product-details', component:ProductDetailsComponent},
            {path:'more',component: MoreDetailsComponent}

        ]

        },


    ]

  }
];

1 个答案:

答案 0 :(得分:1)

猜测(因为这个问题对我来说不太清楚)

<button routerLink="../more">Add</button>