Skip to content

Instantly share code, notes, and snippets.

@gucheen
Created June 8, 2015 08:09
Show Gist options
  • Save gucheen/f783b7c6447b6b7461a8 to your computer and use it in GitHub Desktop.
Save gucheen/f783b7c6447b6b7461a8 to your computer and use it in GitHub Desktop.
.ui-select-bootstrap.ng-invalid span.btn.ui-select-toggle {
border-color: #D44950 !important;
}
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