docs(minErr): add location/isrcharg docs

This commit is contained in:
Igor Minar 2013-08-12 13:27:46 -07:00
parent 72dc48ea4d
commit 2c64f3dc17
4 changed files with 12 additions and 7 deletions

View file

@ -0,0 +1,9 @@
@ngdoc error
@name $location:isrcharg
@fullName Wrong $location.search() argument type
@description
To resolve this error, ensure that the first argument for the `$location.search` call is a `string` or an object.
You can use the stack trace associated with this error to identify the call site that caused this issue.
To learn more, please consult the {@link api/ng.$location `$location`} api docs.

View file

@ -1,4 +0,0 @@
@ngdoc error
@name $location:wpt
@fullName Wrong parameter type
@description

View file

@ -375,7 +375,7 @@ LocationHashbangInHtml5Url.prototype =
} else if (isObject(search)) {
this.$$search = search;
} else {
throw $locationMinErr('wpt', 'First parameter of function must be string or an object.');
throw $locationMinErr('isrcharg', 'The first argument of the `$location#search()` call must be a string or an object.');
}
break;
default:

View file

@ -88,10 +88,10 @@ describe('$location', function() {
it('search() should throw error an incorrect argument', function() {
expect(function() {
url.search(null);
}).toThrow('[$location:wpt] First parameter of function must be string or an object.');
}).toThrow('[$location:isrcharg] The first argument of the `$location#search()` call must be a string or an object.');
expect(function() {
url.search(undefined);
}).toThrow('[$location:wpt] First parameter of function must be string or an object.');
}).toThrow('[$location:isrcharg] The first argument of the `$location#search()` call must be a string or an object.');
});