Reputation: 626
HTML CODE
`<mat-form-field>
<input type="file" (change)="onFileSelected($event)" name="categoryImage" >
</mat-form-field>`
TS code
onFileSelected(event){
console.log(event);}
getting error even before operation mat-form-field must contain a MatFormFieldControl. at this line getMatFormFieldMissingControlError
Upvotes: 1
Views: 4734
Reputation: 148
The <mat-form-field>
doesn't support <input type="file" />
and as far as I can see there is nothing that supports it. Just remove the mat-form-field
element entirely.
The form will still work without it.
Upvotes: 1