It's evident that changing window.location.href/reload
to $location.path()
resolves the issue. However, using $location.path
breaks the app in IE but works in Chrome with window
.
The purpose behind this is to update a site when a user logs in or out, requiring a page refresh after altering their route. While $location.path
and $state.go
change the URL but do not trigger a page refresh.
Is there a built-in method in AngularJS for redirecting and reloading a route/page without encountering loop warnings/errors? Alternatively, how can we utilize window.location.href/reload
without causing issues in AngularJS?
Above mentioned error:
Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations...
This results in an extended error message starting with:
[$rootScope:infdig] 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations....