Looking over the routerLinkActive specification vs. the nsRouterLinkActive specification, I noticed you aren't leveraging the exportAs functionality.
Is there a specific reason behind that?
nsRouterLinkActive
routerLinkActive
It would be beneficial to have access to the nsRouterLinkActive directive reference, so that we can access helper functions like isActive.
The use case I am currently stuck in, is trying to eliminate UIView containers in NativeScript. My navigation bar is a custom element that iterates and creates icon buttons. Due to how the views are constructed, we have to place the nsRouterLinkActive on the parent container iterating, otherwise it's not registered.
Our application then has custom branding that injects CSS to overwrite the router links default styling.
Currently I have no "neat" way of accessing if the router link is active or not, besides writing a helper function to check the URL agains the router link I'm passing in.
Desired Code Example:
<app-navbar-item *ngFor="let link of userLinks"
[nsRouterLinkActive]="['active']"
[nsRouterLink]="link.menuLink"
#rla="nsRouterLinkActive"
[active]="rla.isActive"
[item]="link"></app-navbar-item>
This would most likely require a small refactor in the nsRouterLinkActive implementation, as I see you are assigning isActiveLinks in a local reference to a function's scope.
Looking over the
routerLinkActivespecification vs. thensRouterLinkActivespecification, I noticed you aren't leveraging theexportAsfunctionality.Is there a specific reason behind that?
nsRouterLinkActive
routerLinkActive
It would be beneficial to have access to the
nsRouterLinkActivedirective reference, so that we can access helper functions likeisActive.The use case I am currently stuck in, is trying to eliminate UIView containers in NativeScript. My navigation bar is a custom element that iterates and creates icon buttons. Due to how the views are constructed, we have to place the
nsRouterLinkActiveon the parent container iterating, otherwise it's not registered.Our application then has custom branding that injects CSS to overwrite the router links default styling.
Currently I have no "neat" way of accessing if the router link is active or not, besides writing a helper function to check the URL agains the router link I'm passing in.
Desired Code Example:
This would most likely require a small refactor in the
nsRouterLinkActiveimplementation, as I see you are assigningisActiveLinksin a local reference to a function's scope.