0

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?

Chaka15
  • 1,105
  • 1
  • 8
  • 24
Mirin
  • 33
  • 5

1 Answers1

1

You need to import the RouterModule in you AppModule

Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134