mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 19:40:56 +08:00
Adds $location state method allowing to get/set a History API state via pushState & replaceState methods. Note that: - Angular treats states undefined and null as the same; trying to change one to the other without touching the URL won't do anything. This is necessary to prevent infinite digest loops when setting the URL to itself in IE<10 in the HTML5 hash fallback mode. - The state() method is not compatible with browsers not supporting the HTML5 History API, e.g. IE 9 or Android < 4.0. Closes #9027
9 lines
531 B
Plaintext
9 lines
531 B
Plaintext
@ngdoc error
|
|
@name $location:nostate
|
|
@fullName History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API
|
|
@description
|
|
|
|
This error occurs when the {@link ng.$location#state $location.state} method is used when {@link ng.$locationProvider#html5Mode $locationProvider.html5Mode} is not turned on or the browser used doesn't support the HTML5 History API (for example, IE9 or Android 2.3).
|
|
|
|
To avoid this error, either drop support for those older browsers or avoid using this method.
|