Skip to content

Instantly share code, notes, and snippets.

@rakia
Last active December 30, 2020 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rakia/bafb8c1b0a06cf20e9e2b136b2552fb7 to your computer and use it in GitHub Desktop.
Save rakia/bafb8c1b0a06cf20e9e2b136b2552fb7 to your computer and use it in GitHub Desktop.
Angular ChangeDetectorRef
import { ChangeDetectorRef, ChangeDetectionStrategy } from '@angular/core';
...
constructor(private cd: ChangeDetectorRef) {}
ngOnInit() {
this.service.dataList$.pipe(takeUntil(this._unsubscribeAll)).subscribe((data: Invoice[]) => {
this.dataList = data;
this.cd.markForCheck();
});
}
@plamoni
Copy link

plamoni commented Dec 30, 2020

Looks like the curly braces are misplaced: https://gist.github.com/plamoni/4d4ca26be2350f8c666be759745c2e1e

@rakia
Copy link
Author

rakia commented Dec 30, 2020

Looks like the curly braces are misplaced: https://gist.github.com/plamoni/4d4ca26be2350f8c666be759745c2e1e

Thank you for the note plamoni! It's fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment