3

I have an issue with the method MarkForCheck() from ChangeDetectorRef. For one usage I had to use this.cd.markForCheck(); because in console I was getting the values but it was not updating on the view.

setTimeout(() => {
  this.changeDetectorRef.markForCheck();
}, 50)

This resolved my issue.But i guess this is not the right way.Can anyone suggest me how better i can write this?

Melchia
  • 22,578
  • 22
  • 103
  • 117
Sai Prasad
  • 131
  • 9
  • It depends the context which who the caller is for this setTimeout? Is it a observable that run outside Angular? Or just a vanilla template function that triggered by some events? – Vincent Jan 01 '23 at 13:12

0 Answers0