aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive
diff options
context:
space:
mode:
Diffstat (limited to 'src/ng/directive')
-rw-r--r--src/ng/directive/input.js9
-rw-r--r--src/ng/directive/ngRepeat.js7
-rw-r--r--src/ng/directive/select.js4
3 files changed, 11 insertions, 9 deletions
diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js
index 591da99e..31a3ba5d 100644
--- a/src/ng/directive/input.js
+++ b/src/ng/directive/input.js
@@ -475,8 +475,9 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
var patternObj = scope.$eval(pattern);
if (!patternObj || !patternObj.test) {
- throw ngError(5, 'ngPattern error! Expected {0} to be a RegExp but was {1}. Element: {2}',
- pattern, patternObj, startingTag(element));
+ throw minErr('ngPattern')('noregexp',
+ 'Expected {0} to be a RegExp but was {1}. Element: {2}', pattern,
+ patternObj, startingTag(element));
}
return validate(patternObj, value);
};
@@ -928,8 +929,8 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
ngModelSet = ngModelGet.assign;
if (!ngModelSet) {
- throw ngError(6, "ngModel error! Expression '{0}' is non-assignable. Element: {1}", $attr.ngModel,
- startingTag($element));
+ throw minErr('ngModel')('noass', "Expression '{0}' is non-assignable. Element: {1}",
+ $attr.ngModel, startingTag($element));
}
/**
diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js
index 53ab4fdc..c0e2292f 100644
--- a/src/ng/directive/ngRepeat.js
+++ b/src/ng/directive/ngRepeat.js
@@ -191,6 +191,7 @@
*/
var ngRepeatDirective = ['$parse', '$animator', function($parse, $animator) {
var NG_REMOVED = '$$NG_REMOVED';
+ var ngRepeatMinErr = minErr('ngRepeat');
return {
transclude: 'element',
priority: 1000,
@@ -204,7 +205,7 @@ var ngRepeatDirective = ['$parse', '$animator', function($parse, $animator) {
hashFnLocals = {$id: hashKey};
if (!match) {
- throw ngError(7, "ngRepeat error! Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",
+ throw ngRepeatMinErr('iexp', "Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",
expression);
}
@@ -229,7 +230,7 @@ var ngRepeatDirective = ['$parse', '$animator', function($parse, $animator) {
match = lhs.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);
if (!match) {
- throw ngError(8, "ngRepeat error! '_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",
+ throw ngRepeatMinErr('iidexp', "'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",
lhs);
}
valueIdentifier = match[3] || match[1];
@@ -291,7 +292,7 @@ var ngRepeatDirective = ['$parse', '$animator', function($parse, $animator) {
if (block && block.startNode) lastBlockMap[block.id] = block;
});
// This is a duplicate and we need to throw an error
- throw ngError(50, "ngRepeat error! Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}",
+ throw ngRepeatMinErr('dupes', "Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}",
expression, trackById);
} else {
// new never before seen block
diff --git a/src/ng/directive/select.js b/src/ng/directive/select.js
index b7a4f58b..0d5221fb 100644
--- a/src/ng/directive/select.js
+++ b/src/ng/directive/select.js
@@ -300,8 +300,8 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
var match;
if (! (match = optionsExp.match(NG_OPTIONS_REGEXP))) {
- throw ngError(9,
- "ngOptions error! Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",
+ throw minErr('ngOptions')('iexp',
+ "Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",
optionsExp, startingTag(selectElement));
}