Is there a way to call history.pushState() without angular going into an infinite digest loop?
I\'m trying to migrate my app from backend routing to fro
I recently encountered a variation of this problem myself and none of the answers here worked for me in isolation. history.pushState was defined, but only worked if called from the console. I was able to come up with a solution by consolidating a few of the answers here. Here is the code I used to solve this problem:
// Configure $locationProvider html5Mode
app.config(['$locationProvider', function($locationProvider) {
$locationProvider.html5Mode({ enabled: true, requireBase: false, rewriteLinks: false });
}]);
// In controller
$window.history.pushState(null, 'Page Title', '/some_new_url');
I'm running Angular 1.5.5.