angularjs - How to access form validation properties in the controller -


As seen here:

For example, how to use template var: < / P>

  {{myForm.input. $ Validate}}   

In the controller?

  $ scope.myForm.input. $ Valid   

does not do

You save $ $ to $ May add scope .myForm.input. Valid $. Working here.

  & lt; Script & gt; Angular.module ('test', []). Controller ('formController', ['$ scope', function ($ radius) {$ scope.myForm = {} $ $. $ Watch ('myForm.input. $ Valid', function (Newell) {$ scope.valid = NewVal;});}]); & Lt; / Script & gt; & Lt; Form name = "myForm" ng-controller = "formController" & gt; Email: & lt; Input type = "email" name = "input" ng-model = "text" required & gt; {{MyForm.input. $ Valid}} {{valid}} & lt; / Form & gt;    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -