In Angular 8, I have created a generic form with a form array.
I am trying to retrieve all elements that contain the ViewChild id.
However, when I try to output the ViewChild element using console.log, it only displays one element instead of a list. How can I get it to display a list of elements?
What could be causing this issue? How can I fix it?
HTML:
<ngx-mat-file-input #upload disabled="true" class="uploadFild" (change)="showPreview($event,i)" appearance="outline"
formControlName="file" type=file>
</ngx-mat-file-input>
TS:
@ViewChild('upload', { static: false }) pRef: ElementRef[];
function():void {
this.pRef['disabled'] = false;
console.log(this.pRef);
}