Currently our project using default $routeProvider, and i using this "hack", to change url without reloading page:
services.service('$locationEx', ['$location', '$route', '$rootScope', function($location, $route, $rootScope) {
$location.skipReload = function () {
var lastRoute = $route.current;
var un = $rootScope.$on('$locationChangeSuccess', function () {
$route.current = lastRoute;
un();
});
return $location;
};
return $location;
}]);
and in controller
$locationEx.skipReload().path("/category/" + $scope.model.id).replace();
I thinking of replace routeProvider with Ui-Router for nesting routes, but cant find this in UI-Router.
Is this possible - do the same with Angular UI-ROUTER?
Why i need this? Ex: Route for creating new category is /category/new after click SAVE i show success-alert and i want change route /category/new to /caterogy/23 (23 - is id of new item stored in db)