diff options
| author | Igor Minar | 2013-05-24 11:00:14 -0700 | 
|---|---|---|
| committer | Vojta Jina | 2013-05-24 17:03:21 -0700 | 
| commit | b8ea7f6aba2e675b85826b0bee1f21ddd7b866a5 (patch) | |
| tree | f3b34e25e27d088bec9b698b246d49f86281de36 /src/ng/directive/input.js | |
| parent | 88eaea8e7bf025a7805a5d20f5d47472e4f26f6f (diff) | |
| download | angular.js-b8ea7f6aba2e675b85826b0bee1f21ddd7b866a5.tar.bz2 | |
feat(ngError): add error message compression and better error messages
- add toThrowNg matcher
Diffstat (limited to 'src/ng/directive/input.js')
| -rw-r--r-- | src/ng/directive/input.js | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 543ed367..610396a5 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -475,7 +475,8 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {          var patternObj = scope.$eval(pattern);          if (!patternObj || !patternObj.test) { -          throw new Error('Expected ' + pattern + ' to be a RegExp but was ' + patternObj); +          throw ngError(5, 'ngPattern error! Expected {0} to be a RegExp but was {1}. Element: {2}', +                                                      pattern,                   patternObj,   startingTag(element));          }          return validate(patternObj, value);        }; @@ -918,8 +919,8 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$        ngModelSet = ngModelGet.assign;    if (!ngModelSet) { -    throw Error(NON_ASSIGNABLE_MODEL_EXPRESSION + $attr.ngModel + -        ' (' + startingTag($element) + ')'); +    throw ngError(6, "ngModel error! Expression '{0}' is non-assignable. Element: {1}", $attr.ngModel, +        startingTag($element));    }    /** | 
