feat: add exportAs logic for isActive on routerLinkActive directive#940
Merged
sis0k0 merged 2 commits intoNativeScript:masterfrom Aug 19, 2017
sean-perkins:master
Merged
feat: add exportAs logic for isActive on routerLinkActive directive#940sis0k0 merged 2 commits intoNativeScript:masterfrom sean-perkins:master
exportAs logic for isActive on routerLinkActive directive#940sis0k0 merged 2 commits intoNativeScript:masterfrom
sean-perkins:master
Conversation
Contributor
|
run ci |
sis0k0
reviewed
Aug 17, 2017
|
|
||
| private hasActiveLinks(): boolean { | ||
| return this.links.some(this.isLinkActive(this.router)) || | ||
| this.links.some(this.isLinkActive(this.router)); |
Contributor
There was a problem hiding this comment.
I think we don't need that line.
Author
|
I agree the statement did seem unneeded. I wonder why it existed in the Angular repository. Updated nonetheless. |
exportAs logic for isActive on routerLinkActive directive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Included example usage in the
ng-sampleforrouter-outlet-test.ts.Implements the
exportAsfeature for thensRouterLinkActivedirective. Taken from Angular's repository, this allows you to dynamically access theisActivestate of the directive to do additional logic outside of just binding classes.Also includes optimizations to the update cycle, to prevent unnecessary DOM manipulations as called out here: https://github.com/angular/angular/blob/master/packages/router/src/directives/router_link_active.ts#L124