79605739

Date: 2025-05-04 15:07:33
Score: 1
Natty:
Report link

What kind of ChangeDetection Strategy are you using?

If it's OnPush, change detection only runs when inputs change or markForCheck() is manually triggered.

Use ChangeDetectorRef.markForCheck() after setting isFollowing:

constructor(private cdr: ChangeDetectorRef) {}

someEvent() {
  this.isFollowing = !this.isFollowing;
  this.cdr.markForCheck();
}
Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): What kind of
  • Low reputation (0.5):
Posted by: Dmitriy Danylov