mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
docs(minErr): add location/ihshprfx
This commit is contained in:
parent
544d2616b4
commit
72dc48ea4d
4 changed files with 19 additions and 6 deletions
17
docs/content/error/location/ihshprfx.ngdoc
Normal file
17
docs/content/error/location/ihshprfx.ngdoc
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
@ngdoc error
|
||||
@name $location:ihshprfx
|
||||
@fullName Missing Hash Prefix
|
||||
@description
|
||||
|
||||
This error occurs when {@link api/ng.$location $location} service is configured to use a hash prefix but this prefix was not present in a url that the `$location` service was asked to parse.
|
||||
|
||||
For example if you configure `$location` service with prefix `'!'`:
|
||||
```
|
||||
myApp.config(function($locationProvider) {
|
||||
$locationProvider.prefix('!');
|
||||
});
|
||||
```
|
||||
|
||||
If you enter the app at url `http:/myapp.com/#/myView` this error will be throw.
|
||||
|
||||
The correct url for this configuration is `http:/myapp.com/#!/myView` (note the `'!'` after `'#'` symbol).
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
@ngdoc error
|
||||
@name $location:nohash
|
||||
@fullName Missing Hash Prefix
|
||||
@description
|
||||
|
|
@ -168,7 +168,7 @@ function LocationHashbangUrl(appBase, hashPrefix) {
|
|||
: '';
|
||||
|
||||
if (!isString(withoutHashUrl)) {
|
||||
throw $locationMinErr('nohash', 'Invalid url "{0}", missing hash prefix "{1}".', url, hashPrefix);
|
||||
throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url, hashPrefix);
|
||||
}
|
||||
matchAppUrl(withoutHashUrl, this);
|
||||
this.$$compose();
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ describe('$location', function() {
|
|||
it('should throw error when invalid hashbang prefix given', function() {
|
||||
expect(function() {
|
||||
url.$$parse('http://www.server.org:1234/base#/path');
|
||||
}).toThrow('[$location:nohash] Invalid url "http://www.server.org:1234/base#/path", missing hash prefix "#!".');
|
||||
}).toThrow('[$location:ihshprfx] Invalid url "http://www.server.org:1234/base#/path", missing hash prefix "#!".');
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue