I’m using Angular StateProvider for an Ionic App. Following are the states:
$urlRouterProvider.otherwise('/sign-in');
$stateProvider.state('start', {
url: '/sign-in',
templateUrl: 'templates/login.html',
controller: 'loginController'
})
$stateProvider.state('pageshow', {
url: '/dashboard',
templateUrl: 'templates/page_titles.html',
controller: 'pageController',
params:{subStructure:null}
})
$stateProvider.state('titledetail', {
url: '/page-details/:param1',
templateUrl: 'templates/title_detail.html',
controller: 'pageDetailsController',
params: {item: null}
})
I have JSON which I’m supposed to map with the above states. The JSON looks something like this. There can be only two states, pageshow
and titledetail.
How can I set-up the URLs for states such that the folder type objects map to pageshow
and page type objects map to titledetail
.
It’s like folder within a folder with some pages and other folders where other folders have pages and/or folders too. When a folder is clicked the URL is matched to the pageshow
state adn when a page is clicked the URL is matched with titledetail
state. Example folder URLs:
- /dashboard/ (All the content)
- /dashboard/{id}/
- /dashboard/{id}/{id}/
- /dashboard/{id}/{id}/{id}/{id}/
Any help is appreciated