Search code examples
angularangular-ui-router

Angular: child routes using RouterLinkActive not working


Something that should be 'easy' takes me already more than one hour... And I'm pretty stuck now. I just want to add a 'red' color when the 'child' router link becomes 'active'. See the link below:

https://stackblitz.com/edit/angular-pm9tdb

What am I doing wrong?


Solution

  • The link has its own color defined, which takes precedence over the color of its ancestor class. So your selector should be

    .active a