I was working on an application that requires 2 abstract states with nested states, below is an example configuration
$stateProvider .state('app', { url: "/app", abstract: true, templateUrl: "templates/menu.html", controller: "AppController" }) .state('app.screenList', { url: "/app/screenList", views: { 'menuContent': { templateUrl: "templates/screenList.html", controller: "ScreenListController" } } }) .state('app.screen1', { url: "/app/screen1", views: { 'menuContent': { templateUrl: "templates/screen1.html", controller: "Screen1Controller" } } }) .state('app.subapp', { url: "/app/subapp", abstract: true, views: { 'menuContent': { templateUrl: "templates/subapp.html", controller: "SubAppController" } } }) .state('app.subapp.screen1', { url: "/app/subapp/screen1", views: { 'subappContent': { templateUrl: "templates/subappscreen1.html", controller: "SubAppScreen1Controller" } } })
The screenList displays a list of selected screens. When the next navigation happens, everything works fine
screenList > screen1 Press the return key and then subapp.screen1
Clicking on this step works.
Interestingly, when I try to perform the following navigation, the back stops responding and nothing happens.
screenList > screen1 Press the back key and then subapp.screen1 press the back key and then subapp.screen1 again (at this point, pressing the back key does not work. Even the application does not exit.)
I donβt know at all why this is happening, the only conclusion I came to is that if I consistently try to enter subapp.screen1 , the problem arises. If I continue to switch between subapp.screen1 and screen1 , everything works correctly.
I want the back key to react no matter how the state was switched.