Location
$scope.goToEntity = function (id) {
$location.path('/app/session/teacher/' + id);
};
// get the current path
$location.path();
// change the path
$location.path('/newValue');
// All of the setter methods return the same $location object to allow chaining.
// For example, to change multiple segments in one go, chain setters like this:
$location.path('/newValue').search({key: value});