I am receiving the following error with ChangeDetectorRef. Not sure why its suddenly occurring, when other components utilize ChangeDetectorRef. Does anyone know how to solve? Its linking to a Kendo Grid selection.
TypeError: Cannot read property 'detectChanges' of undefined
export class DocumentPropertyGridComponent implements OnInit, OnChanges {
public documentPropertyGridDataSelected: Array<DocumentPropertyGridData> = new Array<DocumentPropertyGridData>();
constructor(private cdr: ChangeDetectorRef) {
}
selectTest(e){
this.documentPropertyGridDataSelected = e.selectedRows;
this.cdr.detectChanges();
}
HTML:
<div>
Selected Count: {{documentPropertyGridDataSelected.length}}
<div>