HTML:
From the reference of NgModelController.$render()
Called when the view needs to be updated. It is expected that the user of the ng-model directive will implement this method.
You need to implement $render() to call it. You can do something like this
myApp.directive('validFile', function () {
return {
require: 'ngModel',
link: function (scope, el, attrs, ngModel) {
ngModel.$render = function () {
ngModel.$setViewValue(el.val());
};
el.bind('change', function () {
scope.$apply(function () {
ngModel.$render();
});
});
}
};
});
DEMO