Opting for $stateProvider is the preferred approach, along with incorporating whitelist plugins to allow access to external resources.
Implement $stateProvider as follows:
.config(function($stateProvider, $urlRouterProvider) {
// Ionic utilizes AngularUI Router which operates based on states
// More information can be found here: https://github.com/angular-ui/ui-router
// Define the various states that the app can exist in.
// Each state's controller can be located in controllers.js
$stateProvider
// establish an abstract state for the tabs directive
.state('tab', {
url: '/tab',
abstract: true,
templateUrl: 'templates/tabs.html'
})
// Each tab maintains its own navigation history stack:
.state('tab.dash', {
url: '/dash',
views: {
'tab-dash': {
templateUrl: 'templates/tab-dash.html',
controller: 'indexController'
}
}
})
.state('tab.chats', {
url: '/chats',
views: {
'tab-chats': {
templateUrl: 'templates/tab-chats.html',
controller: 'CenterListController'
}
}
})
.state('tab.chat-detail', {
url: '/chats/:centerId',
views: {
'tab-chats': {
templateUrl: 'templates/chat-detail.html',
cache:true,
controller: 'CenterDetailController'
}
}
})
.state('tab.manual-Location', {
url: '/manualLocation',
views: {
'tab-account': {
templateUrl: 'templates/tab-account.html',
controller: 'ManualLocationController'
}
}
})
.state('tab.manual-Location-List', {
url: '/manualLocationList/:locationID',
views: {
'tab-account': {
templateUrl: 'templates/manualLocationList.html',
controller: 'ManualLocationListController'
}
}
})
.state('tab.manual-Location-Detail', {
url: '/manualLocationDetail/:centerId',
views: {
'tab-account': {
templateUrl: 'templates/manual-Location-Detail.html',
controller: 'ManualLocationDetailController'
}
}
});
// if no matches are found among the above states, this will serve as the fallback
$urlRouterProvider.otherwise('/tab/dash');
});