diff --git a/src/AngularPublic.js b/src/AngularPublic.js index 53ad5aabfb4f..6c0acb87f323 100755 --- a/src/AngularPublic.js +++ b/src/AngularPublic.js @@ -44,6 +44,7 @@ function publishExternalAPI(angular){ 'isNumber': isNumber, 'isElement': isElement, 'isArray': isArray, + 'minErr': minErr, 'version': version, 'isDate': isDate, 'lowercase': lowercase, diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index 827886a3cbd9..ce0aaa1790a8 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -1,5 +1,7 @@ 'use strict'; +var ngResourceMinErr = angular.minErr('ngResource'); + /** * @ngdoc overview * @name ngResource @@ -448,8 +450,8 @@ angular.module('ngResource', ['ng']). break; case 0: break; default: - throw "Expected up to 4 arguments [params, data, success, error], got " + - arguments.length + " arguments."; + throw ngResourceMinErr('badargs', + "Expected up to 4 arguments [params, data, success, error], got {0} arguments", arguments.length); } var isInstanceCall = data instanceof Resource; diff --git a/src/ngSanitize/sanitize.js b/src/ngSanitize/sanitize.js index 30de2231bf0f..0ee25e08978e 100644 --- a/src/ngSanitize/sanitize.js +++ b/src/ngSanitize/sanitize.js @@ -1,5 +1,7 @@ 'use strict'; +var ngSanitizeMinErr = angular.minErr('ngSanitize'); + /** * @ngdoc overview * @name ngSanitize @@ -269,7 +271,7 @@ function htmlParser( html, handler ) { } if ( html == last ) { - throw "Parse Error: " + html; + throw ngSanitizeMinErr('badparse', "The sanitizer was unable to parse the following block of html: {0}", html); } last = html; }