-
Notifications
You must be signed in to change notification settings - Fork 25k
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
ExpressionChangedAfterItHasBeenCheckedError when changing a component 'non model' value in afterViewInit #15464
Comments
cc @tbosch |
@adrienboulle It's still happening in Angular 4.0.1. (I've just get updated) |
I'm on 4.0.1 and also getting this error |
I had a similar issue when I wanted to dynamically create a component with Hope it helps ;) |
@jesussobrino indeed i've checked the plunker which use @next and the error is still thrown |
This is works as intended, as you are using In dev mode (i.e. you didn't call
|
@tbosch so it was a bug that it worked on angular@2.0.0->2.4.6 ? |
@adrienboulle yes, this was a bug before. In general, whenever you change a bound value during change detection, you should expect this kind of error... |
ok thanks :) |
this happend to me if i use time ago pipe xD |
@Dj-jom2x this just happened to me using Moment.js inside an "impure" pipe. @tbosch, what can be done here? |
i fix my issue ... i always put new date xD as chat time ago inside new msg and old msg object array ... now i put in on variable at the top so the time ago will stay as is .. btwi use socket io |
Check the Everything you need to know about the |
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'm submitting a ...
Current behavior
changing a component 'non model' value in afterViewInit throws
ExpressionChangedAfterItHasBeenCheckedError
if the value has an impact on a method used in the view.in the plunker:
->
getTextDecoration()
returnsnone
before ngAfterViewInit is called (isViewInit === false
)->
getTextDecoration()
returnsunderline
after ngAfterViewInit is called (isViewInit === true
)Expected behavior
it should not throw the error since
getTextDecoration
is just a method and not part of the model.Minimal reproduction of the problem with instructions
http://plnkr.co/edit/k8AsppUH8V2RvPeLJ0JT?p=preview
The text was updated successfully, but these errors were encountered: