login, but it is rendered as plain text, just like if I used login. I'm certain, that there is no mistak" /> login, but it is rendered as plain text, just like if I used login. I'm certain, that there is no mistak" /> login, but it is rendered as plain text, just like if I used login. I'm certain, that there is no mistak"/>

Element <a> not clickable when using routerLink directive

69 Views Asked by At

I have <a routerLink="login">login</a>, but it is rendered as plain text, just like if I used <span>login</span>.

I'm certain, that there is no mistake in my routing, since if I added a button <button (click)="onClick()">navigate</button> and the handler, constructor(private router: Router) {} onClick() { this.router.navigate(['/login']); } this works perfectly.

Any suggestions why i can't navigate with routerLink?

1

There are 1 best solutions below

0
Matthieu Riegler On

You need to import the RouterModule in you AppModule