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
fix(router): RouterLinkActive should update its state right after che… #19449
Closed
Conversation
This file contains 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
…cking the children Closes angular#18983
jasonaden
approved these changes
Oct 17, 2017
jasonaden
added
action: merge
The PR is ready for merge by the caretaker
target: major
This PR is targeted for the next major release
target: patch
This PR is targeted for the next patch release
and removed
target: major
This PR is targeted for the next major release
labels
Oct 17, 2017
tbosch
added a commit
to tbosch/angular
that referenced
this pull request
Oct 18, 2017
…fter checking the children (angular#19449)" This reverts commit c569b75.
Note: This looked good on a global presubmit, but was reverted because it was synced with another change that had to be reverted. |
jmleoni
pushed a commit
to jmleoni/angular
that referenced
this pull request
Oct 6, 2018
…cking the children (angular#19449) Closes angular#18983 PR Close angular#19449
jmleoni
pushed a commit
to jmleoni/angular
that referenced
this pull request
Oct 6, 2018
…fter checking the children (angular#19449)" This reverts commit c569b75. As it was synched together with 5a9ed2d which broke an internal test.
jmleoni
pushed a commit
to jmleoni/angular
that referenced
this pull request
Oct 6, 2018
…cking the children (angular#19449) Closes angular#18983 PR Close angular#19449
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
action: merge
The PR is ready for merge by the caretaker
area: router
cla: yes
target: patch
This PR is targeted for the next patch release
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.
…cking the children
Closes #18983
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number:18983
What is the new behavior?
In general, directives depending on their children break the change detection data flow, unless they do it only to update the DOM. This is what RouterLinkActive used to do--it only updated the DOM. Adding
exportAs
to it made it problematic. Now this directive's state depends on the children, and the state is exposed to other directives. This is why there are so many issues with it.I fixed the directive the same we do it everywhere else: I moved the behavior that breaks the data flow into a promise (we already had a promise before--but it wasn't working properly. we should never update the state after we update the dom. The dom should reflect the state).
There are other ways to solve this problem without breaking the change detection data flow (e.g., defining a separate pipe for that), but they are breaking.
Does this PR introduce a breaking change?
Other information