ExpressionChangedAfterItHasBeenCheckedError Explained

前端 未结 26 1530
慢半拍i
慢半拍i 2020-11-22 14:46

Please explain to me why I keep getting this error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.

Obviously,

26条回答
  •  抹茶落季
    2020-11-22 15:36

    I had this sort of error in Ionic3 (which uses Angular 4 as part of it's technology stack).

    For me it was doing this:

    So I was trying to conditionally change the type of an ion-icon from a pin to a remove-circle, per a mode a screen was operating on.

    I'm guessing I'll have to add an *ngIf instead.

提交回复
热议问题