Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular $location.path() and window.location.reload not working in Safari/Firefox

For some reason this works in IE and Chrome but not Safari and firefox.

$location.path(lastPath);
$window.location.reload(true);

Instead of reloading the last path, $window.location.reload(true) the current page is reloaded. Where as in Chrome an IE the reload occurs after angular's $location.path(lastPath) occur.

like image 397
Mike Lunn Avatar asked Sep 17 '15 19:09

Mike Lunn


2 Answers

Thanks. The below resolves the issue.

$window.location.href = lastPath;
like image 89
Mike Lunn Avatar answered Oct 02 '22 19:10

Mike Lunn


You can do this:

$window.location.href='#/home';
$window.location.reload()
like image 29
Jason Avatar answered Oct 02 '22 19:10

Jason