2016-12-28 71 views
1
@RouteConfig([ 
    { path: '/post/:post_id', component: PostComponent } 
]) 

使用此經典路由策略/post/1715我收到了這個JSON數據。Angular 2中的路徑變量

{ 
    "post_id": 1715, 
    "title": "The Post Title", 
    "urlTitle": "the-post-title", 
    "body": "Blah, blah ... blah" 
} 

但如何通過添加urlTitle的鏈接重定向路由器#1網址風格/post/1715/the-post-title

回答