I encountered a compilation error:
The property with the type DataBindingDirective is not initialized in the constructor and is not definitely assigned.
@ViewChild(DataBindingDirective) dataBinding: DataBindingDirective;
~~~~~~~~~~~
My suspicion is that this issue may be related to package versions, as everything seems to work fine on StackBlitz (see working example: StackBlitz).
Here is a larger portion of the code:
export class NPEComponent implements OnInit {
rowData$: Observable<Array<NPE>> = of([]);
public filter$: Observable<CompositeFilterDescriptor | null>;
@ViewChild(DataBindingDirective) dataBinding: DataBindingDirective; // compilation error here
constructor(private activatedRoute: ActivatedRoute) {
this.filter$ = this.activatedRoute.queryParams.pipe(
map(params => params['name']),
distinctUntilChanged(),
map(searchTerm => {
if (!searchTerm) return null;
return (<CompositeFilterDescriptor>{
logic: 'or',
filters: [ buildFilterItem('organizationName', searchTerm) ]
})
}),
);
}
ngOnInit(): void {
this.rowData$ = this.NPEService.apiNPEGet();
}
Packages versions listed in packages.json :
"dependencies": {
...
},
"devDependencies": {
...
}
}
Angular CLI version in PowerShell:
>ng --version
Angular CLI: 13.3.10
Node: 18.13.0 (Unsupported)
Package Manager: npm 8.19.3
OS: win32 x64
Angular: 13.3.12
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1303.10
@angular-devkit/build-angular 13.3.10
@angular-devkit/core 13.3.10
...
typescript 4.6.4