I am working on rerouting within an application using Angular 2.4 with typescript. The rerouting is triggered by a button click event. Below is the relevant code:
component.html
<button class="btn btn-lg btn-primary" (click)="negotiation()"
[disabled]="!negotiationEnable"
[hidden]="!hiddenElement">
Rerouting Button
</button>
component.ts
negotiation(): void {
// == Console.log this path with parameters here.. ==
this.router.navigate(['/simple-search-details'],
{ queryParams: {id: this._negotiation_id, catalogueId: this._negotation_catalogue_id} });
}
The issue I am facing is that the target URL where the rerouting should lead to is still in development. However, it would be helpful to see how the link appears with the query Parameters and the URL structure.
If I use
console.log(this.router.navigate(...))
to view the command, it results in an Error.
Expected Outcome
/simple-search-details?catalogueId=blah-foo-1bar&id=some-text-id