@MrShakes wrote:
I'm trying to go to a page(template) using $state.go and my code in the controller.js file is:
.controller('NavCtrl', function($scope, $location, $state) {
$scope.openDaily = function() {
$state.go('daily');
};
})It works but for only a millisecond or something as it's redirected BACK to the '/select' page because the $state.otherwise says so, the code in app.js is:
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('select', {
url:'/select',
templateUrl: 'templates/select.html',
controller: 'selectController'
})
.state('daily', {
url:'/daily',
templateUrl: 'templates/daily.html',
controller: 'dailyController'
});
$urlRouterProvider.otherwise('/select');
})What is causing this please?
Posts: 1
Participants: 1