我的路由器功能“导航”有问题,在我的 AppComponent 中:
@RouteConfig([
{path:'/home', name: 'Home', component: HomeComponent, useAsDefault: true, data: {user: null}},
{path:'/dashboard', name: 'Dashboard', component: DashboardComponent}
])
在我的 HomeComponent 中,我试图这样做:
...
constructor(private _router:Router){}
changePage(){
this._router.parent.navigate(["Dashboard"]); // It fails
}
...
它不会向我发送“/dashboard”,这正常吗?
我终于找到了!它正在与:
changePage() {
this._router.navigate(["../Dashboard"]);
}
感谢你们对我的帮助
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)