I am designing a web app with angular.js, the communication within the application is through AJAX, that means when the apps requests a web resources, the url browser address never change.
my app, for example, is showing the building information. The initial url is '/buildings'
, and firstly it will show a list of rooms
'/buildings/rooma'
'/buildings/roomb'
.
whenever I click the room url, the page will load the room info through AJAX without changing the url in the browser address bar
however now the requirement asks me to bookmark each url, so it means whenever I click a room url, the browser address bar has to show the room url as well rather than the initial url.
How could I do it in angularjs or even without angularjs framework?
update :
I have tried the solution suggested by Ľuboš Beran
$scope.$on('$locationChangeSuccess',function(evt, absNewUrl, absOldUrl) {
console.log('success', evt, lastRoute,$route.current);
$route.current = lastRoute;
});
but the $route.current gives me undefined data.