0
votes

app.component.html

<app-header></app-header>
<router-outlet></router-outlet>
<app-footer></app-footer>

my header component is in coreModule. I already imported RouterModule in coreModule still my [routerLink]="['/login']" is not working in header component.

When i used same code in other component which is rendered inside router-outlet it is working fine.

1
Any error? How are you importing the RouterModule? - Poul Kruijt
No Error. import { RouterModule } from '@angular/router'; and imports: [ RouterModule ], - rash111
So, it is working, but it doesn't navigate. I guess a route guard is preventing it - Poul Kruijt
where is your /login route defined - C_Ogoo
@rash111 did you resolve this issue? - Poonkodi

1 Answers

0
votes

If its a shared module, Make sure you import the routermodule in the shared.module.ts