Angular2入門系列(五)———— 路由參數設置
路由配置:瀏覽器
{ path: '', component: CarProFile, children: [ { path: 'add', component: CarAdd, } ] } 路由跳轉:
this.router.navigate(['add', { id: this.userid, foo: 'foo' }], { relativeTo: this.route });this
而後瀏覽器的url 是這樣的,參數很明顯。。。url
![圖片上傳中...]code
處理方法 skipLocationChangecomponent
this.router.navigate(['add', { id: this.userid, foo: 'foo' }], { relativeTo: this.route , skipLocationChange: true });
注意:用此方法處理後,會致使頁面的後退按鈕失效。router