What does ngf-select do and why is it needed for form validation?

There is a problem with input files in angular see the next fiddle it will help you.

jsFiddle

in main controller put this, to give the current scope to your prototype scope:

MyCtrl.prototype.$scope = $scope;

after just include this prototype function

MyCtrl.prototype.setFile = function(element) {
var $scope = this.$scope;
$scope.$apply(function() {
    $scope.filename = element.files[0];
});
};

now on input files you can call

onchange="MyCtrl.prototype.setFile(this)"

and it will update the scope 🙂 with will after update the validation on form

Leave a Comment