I have a link that looks like this
The router module is set up to display content based on the above URL structure
{ path: 'criminal/hearings', component: HearingsComponent, pathMatch: 'full'},
Now I want to ensure that the querystring is maintained when a button is clicked.
Button HTML:
<button type="button" (click)="addHearing()" class="btn btn-primary">Add Hearing</button>
Corresponding TypeScript function:
addHearing(){
this.router.navigate(['/cr/edithearings']) // How can I include the querystring???
}
I need to incorporate the existing querystring into the button click event so that it navigates to the correct route while keeping the querystring intact
{ path: 'criminal/edithearings', component: HearingEditComponent, pathMatch: 'full'},