I\'m writing a component with a file picker that uploads a file to our CDN. I\'m trying to add a reactive form on this component to validate the image input, so I can check
The value of is read-only, You need to set the option emitModelToViewChange:false when calling setValue() to avoid that error :
ERROR DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.
SOLUTION :
this.form.get('').setValue(file, {emitModelToViewChange: false});