-
Notifications
You must be signed in to change notification settings - Fork 105
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 for custom points #83
Comments
@weterbogov Hi, It is not an error. This message occurs when the data changed on change detection happens. This will be removed on production build. Will fix this later Thanks |
source => https://stackoverflow.com/questions/43375532/expressionchangedafterithasbeencheckederror-explained I workaround this issue with that:
|
@weterbogov @angelserranoperez Also detectChanges, import { Component, OnInit, ChangeDetectionStrategy, AfterViewInit, ChangeDetectorRef} from '@angular/core';
@Component({
changeDetection: ChangeDetectionStrategy.OnPush
selector: -
......
})
export class AppComponent Implements AfterViewInit {
constructor(private cdr: ChangeDetectorRef) {}
ngAfterViewInit() {
// this is used to renderer the carousel changes
this.cdr.detectChanges();
}
} |
@sheikalthaf any ETA on this ? It Makes the carousel unusable (I can't change the changeDetection strategy, it breaks everything else in my app) |
I really need this fixed |
I think it's an async issue with the data updating after the bindings. I solved using an onMove function to update controller variables so the variables always stay consistent with values:
And then the controller:
|
We had the same problem, and we tried fixing it with the solution from @kmturley (thanks!) but we also needed to have the points set when the carousel was created, which we got around by using a setter on the view child: On the component:
and in the html:
|
Thanks for making awesome carousel for me and Angular community. But please fix it, I know it's not a critical one but in Angular 9 if this error happens debugger will call every time we recompile app .... It's annoying. |
Hey @cqduydev, |
@santoshyadavdev Any updates on this issue? |
Hey @santoshyadavdev you got an update for us yet? |
Get this error, while using nguCarousel custom points:
ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ngForOf: '. Current value: 'ngForOf: 0,1'.
The same error you can see in official sandbox.
What you think about this?
The text was updated successfully, but these errors were encountered: