After subscribing to the FormControl.valueChanges()
triggered by selecting a file on an input
, I noticed that the value emitted does not include the full file path. Is there a way to access this information through subscription, or do we need to retrieve it directly from the element using @ViewChild
? The HTML setup is as follows:
<input #file name='file' id='file' type='file' [formControl]='loadButton'/>
The subscription code looks like this:
this.loadButton.valueChanges
.pipe(untilDestroyed(this))
.subscribe(path => {
console.dir(path);
});
}
After selecting a file, the output in the console is:
C:\fakepath\test.png