我已经阅读了udemy教程以及angular2文档,了解如何进行重定向。这看起来是正确的,但它不工作,并且没有错误消息。我希望我的应用程序在加载后转到/whatsup/today组件。我已经成功地完成了一个重定向,该重定向直接转到一个没有子组件的组件,但是当有一个子组件参与重定向时,重定向不起作用,并且没有错误。
app.routes.ts
export const routes: RouterConfig = [
{path: '', redirectTo:"/whatsup/today", pathMatch:"full"},
{ path: 'whatsup', component: Whatsup,
children:[
{path:"today", component:Calendar,
children:[
{path:'info/:mod-title/:mod-desc/:mod-pic', component:ModalInfo},
{path:'map/:lat/:lng', component:Map}
]
}
]
},
...发布于 2016-07-19 16:48:29
/whatsup/today不会有任何结果。您需要为today的子重定向到/whatsup/today/info/title/desc/pic或/whatsup/today/map/123/456提供“默认路由”
https://stackoverflow.com/questions/38442761
复制相似问题