Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nsRouterLinkActive not working when nsRouterLink is on same element #2321

Closed
yvdv-one opened this issue Feb 2, 2021 · 3 comments · Fixed by #2322
Closed

nsRouterLinkActive not working when nsRouterLink is on same element #2321

yvdv-one opened this issue Feb 2, 2021 · 3 comments · Fixed by #2322

Comments

@yvdv-one
Copy link

yvdv-one commented Feb 2, 2021

Version: "@nativescript/angular": "~10.1.7",

When I put the nsRouterLink on the same element as the nsRouterLinkActive, the style class is not added.
When I put it on an element within, it works as expected.

<GridLayout [nsRouterLink]="/user/bob" nsRouterLinkActive="highlight" [nsRouterLinkActiveOptions]="{exact: true}"> <Label [text]="name" class="menu-text"></Label> </GridLayout>
does not work!

<GridLayout nsRouterLinkActive="highlight" [nsRouterLinkActiveOptions]="{exact: true}"> <Label [nsRouterLink]="/user/bob" [text]="name" class="menu-text"></Label> </GridLayout>
works! (and can be used as a workaround for now)

Maybe this has to do with change in angular?: angular/angular#10098

Best regards,
Yves.

@yvdv-one
Copy link
Author

Thank you for fixing this issue.
I can confirm the style class is now added when nsRouterLink is on the same element as nsRouterLinkActive.

Yves,

@alexonozor
Copy link

I still experience this bug "@nativescript/angular": "^14.0.0",

@invergent
Copy link

invergent commented Aug 22, 2022

I am experiencing this bug too. I am also using "@nativescript/angular": "^14.0.0".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants