I'm trying to put together a CRUD setup for a domain entity that includes a file. On the front end I have an input of type=file, like so:
<input type="file" name="file" ng-model="template.file" required />
As you can see this is bound to my model.
The creation part works well, because it's necessary to add a file at that point, so the file input required validation is satisfied. When editing however, the user may never change the file but because it's a file input and I've not found a way to re-populate it, the required file input field never passes validation.
One way I've thought of is to force the file input field to be valid on load, hence the question title (not sure exactly how to do that) but I realize this may not fit with the principals of Angular.
Is there a reliable way, preferably the "angular way" to do this?