Internet Explorer infinite digest with location change #15556
Description
Bug
Current behavior
http://plnkr.co/edit/7SldRRsrYFO32hiG9abV?p=preview
Infinite digest error in Internet Explorer console after button click
[$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: []
Expected behavior
Location changes without error
Minimal reproduction of the problem with instructions
http://plnkr.co/edit/7SldRRsrYFO32hiG9abV?p=preview with Internet Explorer
Check error console after button click.
Note: this happens when the location change occurs during an $evalAsync
What is the motivation / use case for changing the behavior?
We have a large app with different redirect scenarios that may or may not be local to our app. We wish to set location.href.
-
Angular version: 1.5/1.6
-
Browser: [ IE 11 ]
In internet explorer the hashchange event fires asynchronously. this causes the $locationWatch to think that the $location url was updated as it doesn't match $browser url. It seems like the location logic should know whether a url change occured via $location setters
**Relevant Code:
https://github.com/angular/angular.js/blob/master/src/ng/location.js#L970