aboutsummaryrefslogtreecommitdiffstats
path: root/src/validators.js
diff options
context:
space:
mode:
authorMisko Hevery2010-12-23 00:44:27 +0100
committerMisko Hevery2011-01-10 11:50:11 -0800
commit4f22d6866c052fb5b770ce4f377cecacacd9e6d8 (patch)
tree6bdb1c5eb70cfd7e6bcf143c121c53025a0489a4 /src/validators.js
parentaab3df7aeaf79908e8b6212288b283adb42b1ce6 (diff)
downloadangular.js-4f22d6866c052fb5b770ce4f377cecacacd9e6d8.tar.bz2
complete rewrite of documentation generation
- romeved mustache.js - unified templates - improved testability of the code
Diffstat (limited to 'src/validators.js')
-rw-r--r--src/validators.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/validators.js b/src/validators.js
index 8030c0d0..e9a5feb9 100644
--- a/src/validators.js
+++ b/src/validators.js
@@ -9,13 +9,19 @@ extend(angularValidator, {
* Use regexp validator to restrict the input to any Regular Expression.
*
* @param {string} value value to validate
- * @param {regexp} expression regular expression.
+ * @param {string|regexp} expression regular expression.
+ * @param {string=} msg error message to display.
* @css ng-validation-error
*
* @example
- * <script> var ssn = /^\d\d\d-\d\d-\d\d\d\d$/; </script>
+ * <script> function Cntl(){
+ * this.ssnRegExp = /^\d\d\d-\d\d-\d\d\d\d$/;
+ * }
+ * </script>
* Enter valid SSN:
- * <input name="ssn" value="123-45-6789" ng:validate="regexp:$window.ssn" >
+ * <div ng:controller="Cntl">
+ * <input name="ssn" value="123-45-6789" ng:validate="regexp:ssnRegExp" >
+ * </div>
*
* @scenario
* it('should invalidate non ssn', function(){