I am using Agnularjs and Ionic Framework. I am trying to achieve a nested states, which looks like below,
- Eventmenu(root)
- Home (2 level)
- Home 1 (3 level)
- Home 2
- checkin
- attendee
My routes file looks like,
angular.module('ionicApp', ['ionic'])
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('eventmenu', {
url: "/event",
abstract: true,
templateUrl: "event-menu.html"
})
.state('eventmenu.home', {
url: "/home",
views: {
'menuContent' :{
templateUrl: "home.html"
}
}
})
.state('eventmenu.home.home1', {
url: "/home1",
views: {
'menuContent' :{
templateUrl: "home1.html"
}
}
})
.state('eventmenu.home.home2', {
url: "/home2",
views: {
'menuContent' :{
templateUrl: "home2.html"
}
}
})
.state('eventmenu.checkin', {
url: "/check-in",
views: {
'menuContent' :{
templateUrl: "check-in.html",
controller: "CheckinCtrl"
}
}
})
.state('eventmenu.attendees', {
url: "/attendees",
views: {
'menuContent' :{
templateUrl: "attendees.html",
controller: "AttendeesCtrl"
}
}
})
$urlRouterProvider.otherwise("/event/home");
})
For full example, please see codepen: http://codepen.io/liamqma/pen/mtBne
/event/home
/event/checkin
are working, but
/event/home/home1
/event/home/home2
are not working.
Any help is greatly appreciated. Thanks!