diff options
| author | Misko Hevery | 2010-02-12 19:39:01 -0800 | 
|---|---|---|
| committer | Misko Hevery | 2010-02-12 19:39:01 -0800 | 
| commit | 3f9a2ab9bdfcd12cb7df74b0d38cecf2ee4ac94a (patch) | |
| tree | ac3e6197c742a0771350fe8e15c8d53b85d447c3 /example | |
| parent | 7c8a2ccb8d7b595419dfbe9151928cd2533550e3 (diff) | |
| download | angular.js-3f9a2ab9bdfcd12cb7df74b0d38cecf2ee4ac94a.tar.bz2 | |
added asynchronous validator
Diffstat (limited to 'example')
| -rw-r--r-- | example/widgets.html | 7 | 
1 files changed, 7 insertions, 0 deletions
diff --git a/example/widgets.html b/example/widgets.html index 1d74d243..d3e980a1 100644 --- a/example/widgets.html +++ b/example/widgets.html @@ -8,6 +8,11 @@        $(document).ready(function(){          angular.compile(document).init();        }); +      function asyncValidate(value, callback){ +        var x = value.length % 2 ? null: "even"; +        //callback(x); +        _(callback).delay(1000, x); +      }      </script>      <link rel="StyleSheet" type="text/css" href="../css/angular.css"/>    </head> @@ -20,6 +25,8 @@      <hr/>          <input type="checkbox" name="form.boolean" ng-format="boolean" value="true" checked="checked" />      <input type="checkbox" name="form.boolean" ng-format="boolean" value="true" /> +    <hr/>     +    <input type="text" name="form.async" ng-validate="asynchronous:$window.asyncValidate" />      <pre>  form={{form}}  $invalidWidgets.length={{$invalidWidgets.length}}  | 
