angular.io icon indicating copy to clipboard operation
angular.io copied to clipboard

A little uncertainty with documentation on router's routerLinkActive

Open vovopap opened this issue 9 years ago • 2 comments

I'm submitting a possible documentation error on the router docs page of angular.io; It says 'You can also set the RouterLinkActive directive to a string of classes such as [routerLinkActive]="active fluffy" or bind it to a component property that returns such a string' As i know [routerLinkActive] takes property in the component and it should be [routerLinkActive]="'active fluffy'" (literal variable)

vovopap avatar Jan 20 '17 07:01 vovopap

I noticed this as well.

I am creating an angular-cli app while I read the router docs to have a playground in which to test and get a deeper understanding. When I pasted [routerLinkActive]="active fluffy" into my working app on the <a routerLink="/heros">Heroes</a> link, I got a validation error in WebStorm 2017.1:

Angular Error: Parser Error: Unexpected token 'fluffy' at column 8 in [active fluffy] in @3:28.

For my part, I think it should be changed to routerLinkActive="active fluffy" as the intent seems to be to demonstrate multiple classes, rather than binding to component properties.

blendersfun avatar Jun 19 '17 22:06 blendersfun

Agreed. This will be fixed in the next update to the router guide

brandonroberts avatar Jun 20 '17 00:06 brandonroberts