diff options
| author | Misko Hevery | 2010-12-23 00:44:27 +0100 | 
|---|---|---|
| committer | Misko Hevery | 2011-01-10 11:50:11 -0800 | 
| commit | 4f22d6866c052fb5b770ce4f377cecacacd9e6d8 (patch) | |
| tree | 6bdb1c5eb70cfd7e6bcf143c121c53025a0489a4 /src | |
| parent | aab3df7aeaf79908e8b6212288b283adb42b1ce6 (diff) | |
| download | angular.js-4f22d6866c052fb5b770ce4f377cecacacd9e6d8.tar.bz2 | |
complete rewrite of documentation generation
- romeved mustache.js
- unified templates
- improved testability of the code
Diffstat (limited to 'src')
| -rw-r--r-- | src/Angular.js | 2 | ||||
| -rw-r--r-- | src/validators.js | 12 | ||||
| -rw-r--r-- | src/widgets.js | 3 | 
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  | 
