Created
June 8, 2015 08:09
-
-
Save gucheen/f783b7c6447b6b7461a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ui-select-bootstrap.ng-invalid span.btn.ui-select-toggle { | |
border-color: #D44950 !important; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myModule.directive('uiSelectRequired', function () { | |
return { | |
require: 'ngModel', | |
link: function (scope, element, attrs, ngModel) { | |
scope.$watch(function () { | |
return ngModel.$modelValue; | |
}, function (newValue) { | |
if (ngModel.$modelValue) { | |
ngModel.$setValidity("required", true); | |
} | |
else { | |
ngModel.$setValidity("required", false); | |
} | |
}); | |
} | |
}; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment