在我的路由器配置中,我有一個DashboardComponent
在路徑'dashboard'
下配置,我想在沒有指定路徑時自動將用戶重定向到此路由(空路徑,所以只是/
)。主要路線角度無效配置(空路徑)
這是我的代碼:
const appRoutes: Routes = [
{ path: '', redirectTo: 'dashboard'},
{ path: 'dashboard', component: DashboardComponent },
/* other routes... */
];
未處理的承諾拒絕:航線的無效配置 '{路徑: 「」,redirectTo: 「儀表板」}':請提供 'pathMatch'。 「pathMatch」的默認 值爲「前綴」,但往往意圖是使用 「全」
你應該紀念你的答案被接受。 –
@AndreiMatracaru Stackoverflow允許我在2天后才能接受我自己的答案 – ShinDarth