diff options
| author | Vojta Jina | 2012-03-13 15:55:22 -0700 |
|---|---|---|
| committer | Vojta Jina | 2012-03-13 16:18:14 -0700 |
| commit | 66e6c1ce2c4669076916872c3142159ae46e0a9a (patch) | |
| tree | 0b2d89c27ac817e56e01e6929058a9ad52824493 | |
| parent | 4806d28a29ae5c3f83d8f97c11e692ca2313c9ab (diff) | |
| download | angular.js-66e6c1ce2c4669076916872c3142159ae46e0a9a.tar.bz2 | |
docs(forms): Change validation tokens to lowercase
| -rw-r--r-- | docs/content/guide/dev_guide.forms.ngdoc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/docs/content/guide/dev_guide.forms.ngdoc b/docs/content/guide/dev_guide.forms.ngdoc index 539c673f..c643a613 100644 --- a/docs/content/guide/dev_guide.forms.ngdoc +++ b/docs/content/guide/dev_guide.forms.ngdoc @@ -138,8 +138,8 @@ This allows us to extend the above example with these features: E-mail: <input type="email" ng-model="user.email" name="uEmail" required/><br /> <div ng-show="form.uEmail.$dirty && form.uEmail.$invalid">Invalid: - <span ng-show="form.uEmail.$error.REQUIRED">Tell us your email.</span> - <span ng-show="form.uEmail.$error.EMAIL">This is not a valid email.</span> + <span ng-show="form.uEmail.$error.required">Tell us your email.</span> + <span ng-show="form.uEmail.$error.email">This is not a valid email.</span> </div> Gender: <input type="radio" ng-model="user.gender" value="male" />male @@ -216,8 +216,8 @@ In the following example we create two directives. Size (integer 0 - 10): <input type="number" ng-model="size" name="size" min="0" max="10" integer />{{size}}<br /> - <span ng-show="form.size.$error.INTEGER">This is not valid integer!</span> - <span ng-show="form.size.$error.MIN || form.size.$error.MAX"> + <span ng-show="form.size.$error.integer">This is not valid integer!</span> + <span ng-show="form.size.$error.min || form.size.$error.max"> The value must be in range 0 to 10!</span> </div> @@ -225,7 +225,8 @@ In the following example we create two directives. Length (float): <input type="text" ng-model="length" name="length" smart-float /> {{length}}<br /> - <span ng-show="form.length.$error.FLOAT">This is not valid number!</span> + <span ng-show="form.length.$error.float"> + This is not a valid float number!</span> </div> </form> </div> @@ -241,11 +242,11 @@ In the following example we create two directives. ctrl.$parsers.unshift(function(viewValue) { if (INTEGER_REGEXP.test(viewValue)) { // it is valid - ctrl.$setValidity('INTEGER', true); + ctrl.$setValidity('integer', true); return viewValue; } else { // it is invalid, return undefined (no model update) - ctrl.$setValidity('INTEGER', false); + ctrl.$setValidity('integer', false); return undefined; } }); @@ -260,10 +261,10 @@ In the following example we create two directives. link: function(scope, elm, attrs, ctrl) { ctrl.$parsers.unshift(function(viewValue) { if (FLOAT_REGEXP.test(viewValue)) { - ctrl.$setValidity('FLOAT', true); + ctrl.$setValidity('float', true); return parseFloat(viewValue.replace(',', '.')); } else { - ctrl.$setValidity('FLOAT', false); + ctrl.$setValidity('float', false); return undefined; } }); |
