Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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)

share|improve this question
    
in ui-router you dont have to define a URL for each states, you can navigate from state to state without changing URL –  Jonathan de M. May 10 at 19:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.