I'm using a button on my app that redirects to the previous page.
It looks like this:
<button ng-click="goBack()">Go back</button>
$scope.goBack = function() {
$window.history.back();
}
I want this button to go to the previous URL different of the current URL instead of just the previous page (that can have to the same URL of the current).
Example:
- If I go to
/home
, then/products
, then/products
, and again/products
- Then I would like to recover
/home
.