Check that pushState is not invoked if $browser.url() and $browser.state()
is passed to $browser.url setter.
Also, a minor refactor in $browser.url code and $browser specs.
Refs #9587
IE 10-11+ deserialize history.state on every read, causing simple comparisons
against history.state always return false. Account for that caching
`history.state` on every hashchange or popstate event.
Also:
1. Prevent firing onUrlChange callbacks twice if both popstate and hashchange
event were fired.
2. Fix the issue of routes sometimes not firing the URL change in all browsers.
Closes#9587Fixes#9545
Add support for a configurable vertical scroll offset to `$anchorScroll`.
The offset can be defined by a specific number of pixels, a callback function
that returns the number of pixels on demand or a jqLite/JQuery wrapped DOM
element whose height and position are used if it has fixed position.
The offset algorithm takes into account items that are near the bottom of
the page preventing over-zealous offset correction.
Closes#9368Closes#2070Closes#9360
This helper function can be used to execute a callback only after the
document has completed its loading, i.e. after the `load` event fires
or immediately if the page has already loaded and
`document.readyState === 'complete'`.
This fixes an iOS issue where some events buble only when native listeners are present (see #9509),
but more importantly previously we would pass wrong argument into the `removeEventListenerFn` which
caused native listeners to be never deregistered. Oops!
Closes#9509
Instead of throwing an error when using "track by" and "select as" expressions,
ngOptions will assume that the track by expression is valid, and will use it to
compare values.
Closes#6564
7b6c1d0 created this issue by using `Content-Type` to
determine when to run `fromJson`. Because `HEAD` methods do not contain
a body but are supposed to return the `Content-Type` header that would
have been returned if it was a `GET` this functionality fails.
Closes#9528Closes#9529
The current documentation has a `return` in the middle of nowhere and somewhat complicates the example with unnecessary code. This implements the same code as in the example for the other way of using $q in order to simplify the differences between them.
$exceptionHandler
Add a note in $exceptionHandler's documentation about cases when exceptions are not delegated to
the $exceptionHandler, because they are executed outside of the Angular context. Most notable such
cases being the DOM event listeners registered using jqLite's/jQuery's on/bind methods.
Closes#7909Closes#9318
Since msie is now set to document.documentMode, it's not necessary to keep
the documentMode in a separate property.
Also, msie is a variable global to Angular source so there's no need to
replicate it in $sniffer.
Closes gh-9496
This fixes a regression that was introduced in 2bcd02d. Basically, the problem was that render() removed the wrong option from the select controller since it assumed that the option that was removed has the same label as the excessive option in existingOptions, but this is only correct if the option was popped from the end of the array. We now remember for each label whether it was added or removed (or removed at some point and then added at a different point) and report to the select controller only about options that were actually removed or added, ignoring any options that just moved.
Closes#9418
0d3b69a5f2 broke this by calling $get with an undefined
context, which in strict mode would be undefined. This fixes this by ensuring that the
provider is used as the context, as it was originally.
Closes#9511Closes#9512
Fixes bug when $location.search() is not returning search part of current url.
Previously, the location's internal search object could be set by passing an object to the search()
method. Subsequent changes to the passed search object would be exposed when requesting the search
object, but those changes would not appear in the composed url.
Now, the object is cloned, so the result of location.search() should match the contents of
location.absUrl(), provided the object returned from location.search() is not changed.
Closes#9445
Calling `preventDefault()` on a `$routeChangeStart` event will
prevent the route change and also call `preventDefault` on the `$locationChangeStart` event, which prevents the location change as well.
BREAKING CHANGE:
Order of events has changed.
Previously: `$locationChangeStart` -> `$locationChangeSuccess`
-> `$routeChangeStart` -> `$routeChangeSuccess`
Now: `$locationChangeStart` -> `$routeChangeStart`
-> `$locationChangeSuccess` -> -> `$routeChangeSuccess`
Fixes#5581Closes#5714Closes#9502
BREAKING CHANGE:
Previously, not returning a value would fail silently, and an application trying to inject the
value owuld inject an undefined value, quite possibly leading to a TypeError. Now, the application
will fail entirely, and a reason will be given.
Closes#4575Closes#9210
Prior to this fix if an element that contained ng-show or ng-hide was in its hidden state
then any other animation run on the same element would cause the animation to appear despite
the element itself already being hidden. This patch ensures that NO animations are visible
even if the element is set as hidden.
Closes#9103Closes#9493