V
V
vfvnvsyevsky2015-05-27 18:43:25
JavaScript
vfvnvsyevsky, 2015-05-27 18:43:25

Why doesn't $state.go() work?

Why is nothing happening in $state.go('y');?

.state('y.x', {
            url: '/x',
            templateUrl: "x.html",
            controller: ['$scope', '$http', '$stateParams',
            function( $scope,   $http,   $stateParams) {
                $scope.submit = function() {
                    $http.post('/api/', $scope.model).success(function(data) {
                        $state.go('y');
                    });
                };
            }]
        })

.state('у', {
            url: '/у',
            templateUrl: "у.html",
            controller: ['$scope', '$http',
                function( $scope,   $http) {
                    $http.get('/api/').success(function(data) {
                    })
                }
            ]
        })

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Dedukhin, 2015-05-27
@Demetros

You didn't write $state in your dependencies

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question