【发布时间】:2018-06-12 14:21:03
【问题描述】:
我有一个这样的网址
路由器模块根据这个知道显示
{ path: 'criminal/hearings', component: HearingsComponent, pathMatch: 'full'},
但现在我有一个按钮单击,我想在其中维护查询字符串。
按钮html
<button type="button" (click)="addHearing()" class="btn btn-primary">Add Hearing</button>
打字稿功能
addHearing(){
this.router.navigate(['/cr/edithearings']) // how to include the querystring???
}
我想将现有的查询字符串添加到上面的按钮点击事件中 然后在路由模块中,它与查询字符串一起进入正确的路由
{ path: 'criminal/edithearings', component: HearingEditComponent, pathMatch: 'full'},
【问题讨论】:
标签: javascript angular typescript routes angular-routing