angular-rest-upload icon indicating copy to clipboard operation
angular-rest-upload copied to clipboard

ERROR DOMException: Failed to set the 'value' property on 'HTMLInputElement'

Open fuerst opened this issue 7 years ago • 0 comments

Just a note: Usually the value of <input type="file"> is read-only (in it's View representation). You may need to set the option emitModelToViewChange: false when calling setValue() to avoid the SecurityError: "The operation is insecure." (Firefox) or ERROR DOMException: Failed to set the 'value' property on 'HTMLInputElement' (Chrome, Safari):

this.form.get('<name>').setValue(file, {emitModelToViewChange: true});

I'm curious though why the DOM error is not triggered in your example.

fuerst avatar Oct 24 '17 06:10 fuerst