-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Router. EXCEPTION: Expression has changed after it was checked. #6006
Comments
While you have definitely found a problem and I believe that what you're trying to do ought to work ... and we're looking into it ... I can't find that example you cite anywhere in the docs. Would you please find that location for me? |
Anyway, the reason you're getting this error now is because, in DevMode (which is the default), Angular runs your fn 2x ... once the normal time, and once again during a check to ensure that you aren't changing things that shouldn't change during the same view-generation pass. Semantically, you're not changing anything. You're specifying the same route But technically you're returning a **different array* each time. The solution (for now) is to run your fn inside your component, capture its value in a component property, and bind to that property instead. Here's some pseudo-code:
|
I mean live example from docs. |
I searched the code and couldn't find The problem is real. But it's not in the router doc. I think we should close this one. |
Oh yeah, it's not from doc. I've forked example and have changed it. |
Same as #6005 |
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. |
I use [routerLink]="someFunction('Route')"
This is example which was taked from docs and was changed just app/app.component.ts.
The text was updated successfully, but these errors were encountered: