Hi,
i have a basic ionic tabs app. On load of the page i need to make a service call to get the data and construct template using the data returned from backend.
when i load the page it loads absolutely fine in chrome. But when i open it in mobile it shows a blank page.
here is my config code:
mobileApp.config(function($stateProvider, $urlRouterProvider) {
alert(“in config mobileapp”);
$stateProvider
// setup an abstract state for the tabs directive
.state('tab', {
url: "/tab",
"abstract": true,
templateUrl: "../tabs.html"
})
// state for home page
.state('tab.home', {
url: "/home",
resolve:{
resolve function to get data
},
views: {
'tab-home': {
templateUrl: ../homeTemplate.html',
controller: 'homeController'
}
}
})
// if none of the above states are matched, use this as the fallback(by default load home page)
.state("otherwise", {
url: "*path",
template: "",
controller: [
'$state',
function($state) {
$state.go('tab.home')
}]
});
//$urlRouterProvider.otherwise('/tab/home');
}
Controller:
homeModule.controller(‘homeController’,[’$scope’,‘data’, function($scope,data) {
$scope.data = data;
alert(“in controller”); // code not even reaching here
}]);
it is getting redirected to tab/home but the page is empty and i see a empty screen. none of the alert messages are displayed.
i am stuck on this from 2 days. Any help would be appreciated.