angular-university / reactive-angular-course

How to build Angular applications in Reactive style using plain RxJs - Patterns and Lightweight state management
MIT License
304 stars 380 forks source link

ExpressionChangedAfterItHasBeenCheckedError #3

Open majidmadadi opened 4 years ago

majidmadadi commented 4 years ago

I was following your course and I faced a problem. When creating loading component using completely reactive pattern, I get the "ExpressionChangedAfterItHasBeenCheckedError" error. I have reproduced the error in here.

I think it's an angular bug. What do you think?

rafaelblink commented 4 years ago

You need only to set the change detection method of your component, for more details, check this link: https://www.digitalocean.com/community/tutorials/angular-change-detection-strategy

@Component({
  selector: 'my-app',
  template: `...`,
  changeDetection: ChangeDetectionStrategy.OnPush
})