mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-22 19:23:38 +08:00
docs(minErr): add location/isrcharg docs
This commit is contained in:
9
docs/content/error/location/isrcharg.ngdoc
Normal file
9
docs/content/error/location/isrcharg.ngdoc
Normal 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.
|
||||
@@ -1,4 +0,0 @@
|
||||
@ngdoc error
|
||||
@name $location:wpt
|
||||
@fullName Wrong parameter type
|
||||
@description
|
||||
@@ -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:
|
||||
|
||||
@@ -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.');
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user