Within the controller I added a function to change the view:
$scope.changeView = function(view) {
$location.path(view);
$location.replace();
}
Then within the view I added an ng-click to call this function:
<div ng-click="changeView('/app/new_view')">
From the angular Docs $location.replace() method is used to replace the topmost view in the history stack, instead of adding a new one.
There is a special replace
method which can be used to tell the $location service that the next time the $location service is synced with the browser, the last history record should be replaced instead of creating a new one.
Reference:
https://docs.angularjs.org/guide/$location