I'm having an issue with nested states in UI-Router. I have a two states, and upon button click it should transition to another state, and the url changes, but the template does not. Here is my code for the state logic:
$stateProvider.state('accounts', { url: '/accounts', views: { 'menu': { templateUrl: 'templates/menu.html', controller: 'MenuController' }, 'main': { templateUrl: 'templates/accounts.html', controller: 'AccountsController' } } }); $stateProvider.state('accounts.detail', { url: '/:accountID', views: { 'main': { templateUrl: 'templates/accounts.detail.html', controller: 'AccountsDetailController' } } }); And my button logic: $state.go('accounts.detail', { accountID : account.accountID});
Both of my views are wrapped up in ui-view tags. All other root states work correctly (/home, /orders) however /accounts/:accountID will not trigger the template to load and transition. Any insight will be greatly appreciated.
accountsstate is missing a<ui-view />tag, that would explain the route change but no template. What I'm unsure of though, is in which template (menu.html or accounts.html) you should define that ui-view tag in.