我试图通过单击按钮导航到另一个页面,但它无法工作。可能是什么问题呢。我现在正在学习角2,现在对我来说有点困难。导航到角度为2的按钮的另一个页面
//Routes/Path in a folder call AdminBoard
export const AdminRoutes: Routes =[
{
path: 'dashboard',
component: AdminComponent,
children: [
{path: '', redirectTo: 'Home'},
{path: 'Home', component: HomeComponent},
{path: 'Service', component: ServiceComponent},
{path: 'Service/Sign_in', component:CustomerComponent}
]
}
];
//Button is also in a different folder. Click button to navigate to this page {path: 'Service/Sign_in', component:CustomerComponent}
<button class="btn btn-success pull-right" ><a routerLink="/Service/Sign_in"> Add Customer</a></button>
可能重复的[Angular 2重定向点击](http://stackoverflow.com/questions/37252146/angular-2-redirect-on-click) – Habeeb
尝试这样的事情:'' –