I am trying to access ViewChildren's native elements => HTMLElements, but I keep getting undefined response when I do so. Take a look:
list.html
..
<app-element #someElement *ngFor="let element of elements" [someinput]="someinput"></app-element>
..
list.ts
@ViewChildren("someElement") someElements:QueryList<ElementRef>;
@HostListener("window:resize", ["$event"])
resize(event){
console.log(event);
console.log((this.someElements.first)); //returns ElementComponent as expected
console.log((this.someElements.first.nativeElement)); // nativeElement appears to be undefined
}
I've used ViewChildren numerous times. However, this time it does not work as expected. Is it because ViewChild is an angular component? Am I missing something obvious?