title: Validate angular form programmatically
body: <p>I have an angular directive used as attribute for validating the input.</p>
  
  <p>Input looks like this (jade)  </p>
  
  <pre><code> input.form-control(type='text',  name='subjectinput', id='subjectinput',  subjectid-noprefix-validator='(subject.nosuffix==1)')
  </code></pre>
  
  <p>and validator looks like </p>
  
  <pre><code>.directive('subjectidNoprefixValidator', function () {     
      return {
          require: ['^form', 'ngModel'],
          scope: {
              noprefixformat: '=subjectidNoprefixValidator'
          },
          link: function (scope, element, attrs, ctrls) {
  
              scope.form = ctrls[0]; // so we can use form reference in displaying error messages
              var ngModel = ctrls[1];
              ngModel.$validators.subjectidnoprefix = function (value) { 
                  var status = true;
                  // removed some logic that sets status true or false
                  // using   $scope.noprefixformat parameter
                  return status;
              };
          }
      };
  });
  </code></pre>
  
  <p>It works fine. However, sometimes in page actions an event happens that need validation to be re-triggered on the INPUT without touching it; some radio button alteration should re-trigger it and refresh validation status (as you see, my validator has a parameter).</p>
  
  <p>I tried to achieve it by calling in page Controller</p>
  
  <pre><code> $scope.subjCreationForm.subjectinput.$validate(); 
  </code></pre>
  
  <p>but it does not seem to work. What could be the case and is there another way to trigger validation of a field programmatically when it employs $validators?</p>