angularjs - Ionic $state.go not working on device -


i'm working on app, build using ionic. problem $state.go working in browser not on phone. seem common problem, after reading lot of answers same questions, still can't figure out how fix it.

the general fix seems to ensure you're using relative urls explained here: using angular ui-router phonegap still can't work. missing?

link plunker: http://plnkr.co/edit/qfj1ld6bhkvkmksmyqc8?p=preview

app.js structure:

    ....     $stateprovider       .state('parent', {       url: "/",       templateurl: "parent.html"     })     .state('parent.child', {       url: "child",       templateurl: "child.html"     })     $urlrouterprovider.otherwise("/")     })     .... 

for state.go work have inject $state dependency 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 have register state want goto in $stateprovider

$stateprovider .state('menu.kategorier', {...}) 

and state have go parent state 'menu' in case. cannot change state 'parent' 'menu.kategorier' can goto 'parent.child' 'parent'


Comments

Popular posts from this blog

html - height not adding height to a empty div -

Oracle SQL. How to select specific IDs where value of columns specify criteria? -

python - Robot Framework location and name of keyword -