Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat($location): add support for History API state handling #9476

Closed
wants to merge 1 commit into from

Conversation

IgorMinar
Copy link
Contributor

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

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 angular#9027
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants