Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
fix(router): RouterLinkActive should update its state right after che… #19449
…cking the children
Please check if your PR fulfills the following requirements:
What kind of change does this PR introduce?
What is the current behavior?
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
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?