angularjs - Regex with ng-if -


  <div class="row" ng-if="mytest.item.mypassword != mytest.item.confirmpassword">        <div class="col-md-12">       <p class="red-color"> password must between 4 , 8 digits long , include @ least 1 numeric digit , passwords must match! </p>         </div>  </div> 

i need show above message when "mypassword != confirmpassword" , regex '/^(?=.*\d).{4,8}$/' not fulfilled password field.how can use regex ng-if ? highly appreciated.

on view:

ng-if="isvalid()" 

in controller:

$scope.isvalid = function(){    return mytest.item.mypassword == mytest.item.confirmpassword            && yourregexp.test(mytest.item.mypassword); } 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -