Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

style(minerr): prefer component name as namespace #3527

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@ngdoc error
@name ngResource:badargs
@name $resource:badargs
@fullName Too Many Arguments
@description

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@ngdoc error
@name ngResource:badcfg
@name $resource:badcfg
@fullName Response does not match configured parameter
@description

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@ngdoc error
@name ngSanitize:badparse
@name $sanitize:badparse
@fullName Parsing Error while Sanitizing
@description

Expand Down
8 changes: 4 additions & 4 deletions src/ngResource/resource.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var ngResourceMinErr = angular.$$minErr('ngResource');
var $resourceMinErr = angular.$$minErr('$resource');

/**
* @ngdoc overview
Expand Down Expand Up @@ -449,7 +449,7 @@ angular.module('ngResource', ['ng']).
break;
case 0: break;
default:
throw ngResourceMinErr('badargs',
throw $resourceMinErr('badargs',
"Expected up to 4 arguments [params, data, success, error], got {0} arguments", arguments.length);
}

Expand All @@ -474,8 +474,8 @@ angular.module('ngResource', ['ng']).

if (data) {
if ( angular.isArray(data) != !!action.isArray ) {
throw ngResourceMinErr('badcfg', 'Error in resource configuration. Expected response' +
' to contain an {0} but got an {1}',
throw $resourceMinErr('badcfg', 'Error in resource configuration. Expected response' +
' to contain an {0} but got an {1}',
action.isArray?'array':'object', angular.isArray(data)?'array':'object');
}
if (action.isArray) {
Expand Down
4 changes: 2 additions & 2 deletions src/ngSanitize/sanitize.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var ngSanitizeMinErr = angular.$$minErr('ngSanitize');
var $sanitizeMinErr = angular.$$minErr('$sanitize');

/**
* @ngdoc overview
Expand Down Expand Up @@ -274,7 +274,7 @@ function htmlParser( html, handler ) {
}

if ( html == last ) {
throw ngSanitizeMinErr('badparse', "The sanitizer was unable to parse the following block of html: {0}", html);
throw $sanitizeMinErr('badparse', "The sanitizer was unable to parse the following block of html: {0}", html);
}
last = html;
}
Expand Down
4 changes: 2 additions & 2 deletions test/ngResource/resourceSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ describe('resource', function() {

expect(successSpy).not.toHaveBeenCalled();
expect(failureSpy).toHaveBeenCalledWith(
'[ngResource:badcfg] Error in resource configuration. Expected response to contain an array but got an object');
'[$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object');
});

it('should fail if action expects an array but response is an object', function() {
Expand All @@ -1076,7 +1076,7 @@ describe('resource', function() {

expect(successSpy).not.toHaveBeenCalled();
expect(failureSpy).toHaveBeenCalledWith(
'[ngResource:badcfg] Error in resource configuration. Expected response to contain an object but got an array');
'[$resource:badcfg] Error in resource configuration. Expected response to contain an object but got an array');
});


Expand Down