Discussion for angular (2+) - need help? create a stackblitz with your issue to get help faster using this template: https://stackblitz.com/fork/angular-issue-repro2
routerLink
to work in a nested component. I have a root component that has a RouterConfig setting up my routes and the template is only <router-outlet></router-outlet>
. In the child components, I'm trying to use <a [routerLink]="['Comp']">
while no errors get thrown, the href
isn't generated. What's interesting though is that if I inject the Router in the child component's class, I can call this._router.navigate(['Comp'])
and it works just fine. Am I just missing something?