2

I am using Angular2 RC3 and the new router. My HTML ...

<nav>
  <a [routerLink]="['/route1']" [routerLinkActive]="['active']">Route 1</a>
  <a [routerLink]="['/route2']" [routerLinkActive]="['active']">Route 2</a>
</nav>

routerLinkActive applies the 'active' class according to the selected link. Works great.

Problem is by adding [routerLinkActive] my unit tests now fail with ...

undefined is not an object (evaluating 'router.events.subscribe')

anyone got a fix for this?

many thanks

4

1 回答 1

0

i put the tests on 'skip' in the end using Jasmine's xit

This is no longer a problem on ng2 final release

于 2016-10-23T04:50:27.737 回答