I have a URL which is like this
The router module knows to display based on this
{ path: 'criminal/hearings', component: HearingsComponent, pathMatch: 'full'},
but now I have a button click in which I want to maintain the querystring.
button html
<button type="button" (click)="addHearing()" class="btn btn-primary">Add Hearing</button>
typescript function
addHearing(){
this.router.navigate(['/cr/edithearings']) // how to include the querystring???
}
I want to add the existing querystring to above button click event then in the route module it goes to proper route, along with the querystring
{ path: 'criminal/edithearings', component: HearingEditComponent, pathMatch: 'full'},