我是角度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}
]
},
]
}
];
答案 0 :(得分:1)
猜测(因为这个问题对我来说不太清楚)
<button routerLink="../more">Add</button>