Angular4 - routerLink with typescript

In code, you use .navigate instead:

this.router.navigate(['/products']);

You pass it the same parameter as you do the routerLink.

enter image description here


try this

<a javascript:void(0) routerLink="inscription" class="btn btn-default">Inscription</a>

Please note that though the URL in the browser is not case sensitive, Router.navigate is.

Correct: this.router.navigate(['/products']);.

Incorrect: this.router.navigate(['/Products']);