mercredi 18 mars 2020

Facing Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked

I am trying to assign random color to the div background using below example

Random Color

But facing below error:

Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.

You can check in console of created stackblitz.

I have already tried below answers:

  1. How to manage Angular2 "expression has changed after it was checked" exception when a component property depends on current datetime
  2. Expression ___ has changed after it was checked

But no luck! Can anyone please look into this and help?




Aucun commentaire:

Enregistrer un commentaire