Ionic views not working in emulator and device


#1

I really new to ionic. I have started an app with ionic. My views work correctly in the browser. But when i try to load in my mobile device(Samsung galaxy S3) or in the Emulator(Google Nexus) the navigation doesn’t work enterly.

    mobile.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider){
    $stateProvider.state('tab', {
        url: "/tab",
        abstract: true,
        templateUrl: "app/partials/root/tabs.html"
    })
        .state('tab.home',{
            url: "/home",
            views: {
                'dashboard': {
                    templateUrl: 'app/partials/home/dashboard.html'
                }
            }
        })

        .state('tab.search', {
            url: "/search",
            views: {
                'search': {
                    templateUrl: 'app/partials/search/search.html'
                }
            }
        })
        .state('tab.login', {
            url: "/login",
            views: {
                'login': {
                    templateUrl: 'app/partials/user/login.html'
                }
            }
        })
        .state('tab.ticket', {
            url: "/ticket",
            'views': {
                'ticket': {
                    templateUrl: 'app/partials/bet/ticket.html'
                }
            }
        })
        .state('tab.sportBetting', {
          url: "/betting",
          'views': {
            "dashboard": {
                templateUrl: 'app/partials/bet/sport-betting.html',
                controller: 'sportBettingCtrl'
            }
          }
        })
        .state('tab.countryBetting', {
            url: "/country",
            views: {
                "dashboard": {
                    templateUrl: 'app/partials/bet/country-betting.html',
                    controller: 'CountryBettingCtrl'
                }
            }



        })
        .state('tab.liveBetting', {
            url: "/live",
            'views': {
                "dashboard": {
                    templateUrl: 'app/partials/live/live-betting.html'
                }
            }
        })

    ;
    $urlRouterProvider.otherwise('/tab/home');
    $ionicConfigProvider.views.transition("android");
    $ionicConfigProvider.tabs.position("bottom");
    $ionicConfigProvider.navBar.alignTitle("center");
});

I can acces the home view (Dashboard) i can also navigate to the sportBetting. But when i try to access the Country betting from the sport-betting.html it’s does not wok on my mobile phone. But it work correctly on my browser. what could be the problem?


#2

Is the page showing fine? If not could you please try removing app/ from the templateUrl.


#3

Have you enabled developer options of the device if not Please follow the below steps it would be easy to see if there is any errors in the console

Go To Settings --> More --> About Device --> Build Number (click on build number for 7 times and it will enable the developer options in settings)

Then Go to Settings --> Developer Options – > USB debugging (enable it)
then connect the device to USB cable and open “chrome://inspect/#devices” then you should be running you app under debug mode. See if there are any error under console (F12)