angularjs - Angular directive for validation using two models -


After the "text" itemprop = "text">

using the new $ authenticator objection on ngModel, I in addition to an input data area in the input field in addition Validate the directivity works great in a checkbox if the checkbox (un) is checked before the user input, but if the user is input and then clicks on the checkbox, there is no verification Is not.

Is there a way to trigger the verification box, either the checkbox or input field changes?

The code looks like this:

  app.directive ('denyMultiples', function () {return required: 'ngModel', scope: {denyMultipleCheck: '='}, Link: function (scope, element, attrs, ngModel) {ngModel $ validators.multiples = function (value). {{Value = value.split (',') (Array.isArray (value)! );} Return value.length & lt; 2 || scope.denyMultipleCheck;};}};}); // HTML & lt; Input name = "item" deny-multiples deny-multiples-check = "query.deny_multiples_check" ng-model = "item" & gt;    

I use to determine whether it was able to meet ng required , Then the verifier should not be run or not

  & lt; Input name = "item" denial-multiples denial-multiples-check = "query.deny_multiples_check" ng-required = "query.deny_multiples_check" ng model = "item" & gt; If the checkbox is checked, the $ validation will be run. Otherwise the check is ignored.   

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -