diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 0a416653532b..676bf19fd735 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -6,7 +6,7 @@ DIRTY_CLASS: false, UNTOUCHED_CLASS: false, TOUCHED_CLASS: false, - $ngModelMinErr: false, + ngModelMinErr: false, */ // Regex code is obtained from SO: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231 @@ -1170,7 +1170,7 @@ function createDateInputType(type, regexp, parseDate, format) { ctrl.$formatters.push(function(value) { if (value && !isDate(value)) { - throw $ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value); + throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value); } if (isValidDate(value)) { previousDate = value; @@ -1247,7 +1247,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) { ctrl.$formatters.push(function(value) { if (!ctrl.$isEmpty(value)) { if (!isNumber(value)) { - throw $ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value); + throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value); } value = value.toString(); } @@ -1340,7 +1340,7 @@ function parseConstantExpr($parse, context, name, expression, fallback) { if (isDefined(expression)) { parseFn = $parse(expression); if (!parseFn.constant) { - throw minErr('ngModel')('constexpr', 'Expected constant expression for `{0}`, but saw ' + + throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' + '`{1}`.', name, expression); } return parseFn(context); diff --git a/src/ng/directive/ngModel.js b/src/ng/directive/ngModel.js index b9be7f2d734a..b7951acc8210 100644 --- a/src/ng/directive/ngModel.js +++ b/src/ng/directive/ngModel.js @@ -16,8 +16,7 @@ var VALID_CLASS = 'ng-valid', TOUCHED_CLASS = 'ng-touched', PENDING_CLASS = 'ng-pending'; - -var $ngModelMinErr = new minErr('ngModel'); +var ngModelMinErr = minErr('ngModel'); /** * @ngdoc type @@ -268,7 +267,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$ } }; } else if (!parsedNgModel.assign) { - throw $ngModelMinErr('nonassign', "Expression '{0}' is non-assignable. Element: {1}", + throw ngModelMinErr('nonassign', "Expression '{0}' is non-assignable. Element: {1}", $attr.ngModel, startingTag($element)); } }; @@ -597,7 +596,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$ forEach(ctrl.$asyncValidators, function(validator, name) { var promise = validator(modelValue, viewValue); if (!isPromiseLike(promise)) { - throw $ngModelMinErr("$asyncValidators", + throw ngModelMinErr("$asyncValidators", "Expected asynchronous validator to return a promise but got '{0}' instead.", promise); } setValidity(name, undefined);