1

I begining on Wakanda Angular. And I have a problem for to change page. When I opening my application, I would like arrive new.html page. Anyone can help me?

app.js:

angular.module('starter', ['ionic', 'wakanda']) 

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    if(window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
      cordova.plugins.Keyboard.disableScroll(true);
    }
    if(window.StatusBar) {
      StatusBar.styleDefault();
    }
  });
})

.config(function ($stateProvider, $urlRouterProvider){
    $stateProvider
    .state('home',{
        url:'/home',
        templateUrl:'view/home.html',
        cache:false
    })
    .state('new', {
      url: '/new',
      controller: 'NewController',
      templateUrl: 'view/new.html',
      cache: false
    })
    $urlRouterProvider.otherwise('new');
})

.controller('NewController', function($scope, $state) {
    console.log("test");
});##
Pratoux
  • 87
  • 8
  • 1
    When I opening my application, I would like arrive new.html page but I arrive on index.html. new.html is in view folder. – Pratoux Mar 22 '17 at 15:22

1 Answers1

1

I edited my answer, can you please try the code below, change the url: to '/' and also the url in $urlRouterProvide

.config(function ($stateProvider, $urlRouterProvider){
        $stateProvider
        .state('home',{
            url:'/home',
            templateUrl:'view/home.html',
            cache:false
        })
        .state('new', {
          url: '/',
          controller: 'NewController',
          templateUrl: 'view/new.html',
          cache: false
        })
        $urlRouterProvider.otherwise('/');
    })
Bambie
  • 26
  • 5