For state.go to work, you need to enter a $ state dependency on your controller
app.controller('ParentCtrl', ['$scope', '$state', function($scope, $state) { $scope.$state = $state }]); app.controller('MenuCtrl', ['$scope', '$state', function($scope, $state){ $scope.goTo = function(){ $state.go('menu.kategorier'); } }]);
and you must register the state you want to go to $ stateProvider
$stateProvider .state('menu.kategorier', {...})
and to go into this state, you need to go from the parent state, for example, to the "menu". you cannot change the state from parent to "menu.kategorier", but you can go to "parent.child" from "parent"
source share