我試圖通過單擊按鈕導航到另一個頁面,但它無法工作。可能是什麼問題呢。我現在正在學習角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
嘗試這樣的事情:'' –