aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Angular.js2
-rw-r--r--src/validators.js12
-rw-r--r--src/widgets.js3
3 files changed, 12 insertions, 5 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 59b031cc..00e1d2a2 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -711,7 +711,7 @@ function concat(array1, array2, index) {
*/
function bind(self, fn) {
var curryArgs = arguments.length > 2 ? slice.call(arguments, 2, arguments.length) : [];
- if (typeof fn == $function) {
+ if (typeof fn == $function && !(fn instanceof RegExp)) {
return curryArgs.length ? function() {
return arguments.length ? fn.apply(self, curryArgs.concat(slice.call(arguments, 0, arguments.length))) : fn.apply(self, curryArgs);
}: function() {
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(){
diff --git a/src/widgets.js b/src/widgets.js
index 5f159990..473b6f1f 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -554,7 +554,8 @@ angularWidget('option', function(){
* (e.g. ng:include won't work for file:// access).
*
* @param {string} src expression evaluating to URL.
- * @param {Scope=} [scope=new_child_scope] expression evaluating to angular.scope
+ * @param {Scope=} [scope=new_child_scope] optional expression which evaluates to an
+ * instance of angular.scope to set the HTML fragment to.
* @param {string=} onload Expression to evaluate when a new partial is loaded.
*
* @example