Hi,

I am trying to add a read border around the drop-down if the user hasn't 
selected any valid value. Can I get some advice about this ?
I think the normal 'required' attribute didn't work due to some overlay. So 
I am trying to use a directive.

directive('stylevalidate', function ($compile) {
  return {
    restrict: 'A',
    link: function (scope, element, attrs,ngModel) {

          if (!element.attr('required')){
            element.attr("required", true);
            console.log('Styling the validation [' + element  + ']');
            element.addClass('red');
            $compile(element)(scope);
          }
    }
  };
})

Thanks,
Mohan

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to