diff options
| author | Igor Minar | 2013-08-12 12:04:03 -0700 |
|---|---|---|
| committer | Igor Minar | 2013-08-12 14:09:08 -0700 |
| commit | 72dc48ea4d7e97c9dd3a9f469698ed77bcbdedbe (patch) | |
| tree | 70a1d704c8caa5a130c7e2406ec802f9f41c778e | |
| parent | 544d2616b429e5059a1ff117c483102b7495b992 (diff) | |
| download | angular.js-72dc48ea4d7e97c9dd3a9f469698ed77bcbdedbe.tar.bz2 | |
docs(minErr): add location/ihshprfx
| -rw-r--r-- | docs/content/error/location/ihshprfx.ngdoc | 17 | ||||
| -rw-r--r-- | docs/content/error/location/nohash.ngdoc | 4 | ||||
| -rw-r--r-- | src/ng/location.js | 2 | ||||
| -rw-r--r-- | test/ng/locationSpec.js | 2 |
4 files changed, 19 insertions, 6 deletions
diff --git a/docs/content/error/location/ihshprfx.ngdoc b/docs/content/error/location/ihshprfx.ngdoc new file mode 100644 index 00000000..cb1189dd --- /dev/null +++ b/docs/content/error/location/ihshprfx.ngdoc @@ -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). diff --git a/docs/content/error/location/nohash.ngdoc b/docs/content/error/location/nohash.ngdoc deleted file mode 100644 index 81f0d569..00000000 --- a/docs/content/error/location/nohash.ngdoc +++ /dev/null @@ -1,4 +0,0 @@ -@ngdoc error -@name $location:nohash -@fullName Missing Hash Prefix -@description diff --git a/src/ng/location.js b/src/ng/location.js index f4f77c2f..e64a97d5 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -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(); diff --git a/test/ng/locationSpec.js b/test/ng/locationSpec.js index 4df6eb43..383783bb 100644 --- a/test/ng/locationSpec.js +++ b/test/ng/locationSpec.js @@ -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 "#!".'); }); |
