0

I have root page with child pages, root page template has [routerLink] directives that route to child pages. Something like this:

<a [routerLink]="['/home', 'auidiences']"></a>
<router-outlet></router-outlet>

HomeComponуnt has ROUTER_DIRECTIVES in directives section.*

When I navigate to page at first time links don't have hrefs, but if I update page they do and work. Any idias?

Lyubimov Roman
  • 1,269
  • 15
  • 27

1 Answers1

1

The reason is as I understand related to this bug. And one more - user answer. OnInit doesn't fire and there is no component that works fine after router navigation.

To solve this problem you need to wrap your navigation call into zone.run().

Lyubimov Roman
  • 1,269
  • 15
  • 27
  • Looks like this issue should be fixed in RC.5 (when it is released) – Günter Zöchbauer Jul 18 '16 at 05:20
  • It would be nice. How do you know? – Lyubimov Roman Jul 18 '16 at 05:27
  • I just looked at the closed date of the issue you linked to but it wasn't closed as "fixed" therefore my comment is misleading - sorry. https://github.com/angular/angular/issues/6867#issuecomment-230814944 mentioned it is working in RC.4 already but a comment below mentions it not working for in RC.4. It could be a mistake in the polyfills loading order though. – Günter Zöchbauer Jul 18 '16 at 05:42