blob: 69b0487d12ceb993c0c3c8d8e0c2bce4ef4bbeb8 [file] [log] [blame]
beccabroeka09cc2d2019-01-23 14:26:55 -06001angular.module('app.common.directives').directive('hasError', function() {
2 return {
3 scope: {hasError: '='},
4 require: 'ngModel',
5 link: function(scope, elm, attrs, ngModel) {
6 scope.$watch('hasError', function(value) {
7 ngModel.$setValidity('hasError', value ? false : true);
8 });
9 }
10 };
11});