我在使用{static:true}时看到组件使用崩溃
Comparator.comparingInt
组件代码如下
Cannot read property 'nativeElement' of undefined: "TypeError: Cannot read property 'nativeElement' of undefined
基于此处的文档,我的期望是,当我说{static:true}时,我的ViewChild是可以安全地在ngAfterViewInit中访问和使用的,因为它在ngOnInit-https://angular.io/guide/static-query-migration
之前就可以使用了。这种理解不正确吗?
任何指针都值得赞赏。
谢谢