blob: 69b0487d12ceb993c0c3c8d8e0c2bce4ef4bbeb8 [file] [log] [blame]
angular.module('app.common.directives').directive('hasError', function() {
return {
scope: {hasError: '='},
require: 'ngModel',
link: function(scope, elm, attrs, ngModel) {
scope.$watch('hasError', function(value) {
ngModel.$setValidity('hasError', value ? false : true);
});
}
};
});