I am attempting to automatically update an array within a Listview by utilizing ChangeDetectorRef in the following way:
import { Component, OnInit, ChangeDetectionStrategy, Input, ChangeDetectorRef } from "@angular/core";
@Component({
selector: "register",
templateUrl: "./register.html",
styleUrls: ["./register.css"],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class RegisterComponent implements OnInit {
@Input regis = Array<string>;
constructor(cdr: ChangeDetectorRef){}
ngAfterContentChecked() {
this.cdr.detectChanges();
}
However, I encountered this error :
error TS2339: Property 'cdr' does not exist on type 'RegisterComponent'.
Can someone clarify what I may have misunderstood?