我想在我的AddUserComponent中提交表單之後回到我的父組件。如何返回到Angular 2中的父組件
我的網址應該改變:/video/1/user
到/video/1
我試圖
this._router.navigate(['../../video'],{ relativeTo: this.route })
this._router.navigate(['../../video',{video_id:1}],{ relativeTo: this.route })
,但它不工作。
我的路線:
export const routes = [
{ path: '', component: VideosComponent },
{
path: 'video/:video_id',
children :[
{ path: '', component: VideoComponent },
{
path: 'user',
children :[
{ path: '', component: AddUserComponent },
{ path: ':user_id',
children :[
{ path: '', component: EditUserComponent}
]
}
]
},
]
}
];
任何想法?
你檢查[這個答案](http://stackoverflow.com/a/38810729/2435473)? –