I try to use the component @angular-material-components/file-input in the project on Angular I look at examples of its use: file-input
<mat-form-field>
<ngx-mat-file-input [formControl]="fileControl">
</ngx-mat-file-input>
</mat-form-field>
ts:
export class DemoFileInputComponent implements OnInit {
fileControl: FormControl;
constructor() {
this.fileControl= new FormControl(this.files);
}
ngOnInit() {
this.fileControl.valueChanges.subscribe((files: any) => {
if (!Array.isArray(files)) {
this.files = [files];
} else {
this.files = files;
}
console.log('valueChanges');
})
}
Everything works on the form, I select the file, it appears in the input field. But I don't understand how I can get its name and full path in the code? The method this.fileControl.valuechanged.subscribe is not triggered when a file is selected