{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic/issues/3689","labels_url":"https://api.github.com/repos/driftyco/ionic/issues/3689/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic/issues/3689/comments","events_url":"https://api.github.com/repos/driftyco/ionic/issues/3689/events","html_url":"https://github.com/driftyco/ionic/issues/3689","id":74519798,"number":3689,"title":"bug: ui-router state ordering breaks tabs app","user":{"login":"thebalaa","id":109041,"avatar_url":"https://avatars.githubusercontent.com/u/109041?v=3","gravatar_id":"","url":"https://api.github.com/users/thebalaa","html_url":"https://github.com/thebalaa","followers_url":"https://api.github.com/users/thebalaa/followers","following_url":"https://api.github.com/users/thebalaa/following{/other_user}","gists_url":"https://api.github.com/users/thebalaa/gists{/gist_id}","starred_url":"https://api.github.com/users/thebalaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thebalaa/subscriptions","organizations_url":"https://api.github.com/users/thebalaa/orgs","repos_url":"https://api.github.com/users/thebalaa/repos","events_url":"https://api.github.com/users/thebalaa/events{/privacy}","received_events_url":"https://api.github.com/users/thebalaa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/driftyco/ionic/labels/ionitron:closed","name":"ionitron:closed","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-08T22:40:26Z","updated_at":"2015-06-13T02:38:43Z","closed_at":"2015-06-13T02:38:43Z","body":"**Type**: <span ionic-type>bug</span>\r\n\r\n**Platform**: <span ionic-platform>all</span>  \r\n\r\n<span ionic-description>I have an app based on the \"tabs\" starter application. I'm curious as to why the order of the states listed below breaks the application; is this expected behavior?  In the instance where it doesn't work, clicking the settings tabs presents and empty tab window with a \"< Back\" on the left side of the header. The only difference is the order in which the states are defined. Thanks!\r\n\r\nThe following code works as expected\r\n```\r\n $stateProvider\r\n\r\n     \r\n\r\n  // setup an abstract state for the tabs directive\r\n    .state('orders', {\r\n    url: \"/orders\",\r\n    abstract: true,\r\n    templateUrl: \"templates/tabs.html\",\r\n    // data property is inherited by child states\r\n    data: {\r\n      loginRequired: true\r\n    }\r\n  })\r\n\r\n  // Each tab has its own nav history stack:\r\n\r\n  .state('orders.list', {\r\n    url: '/list',\r\n    views: {\r\n      'orders-list': {\r\n        templateUrl: 'templates/tab-dash.html',\r\n        controller: 'OrderListCtrl'\r\n      }\r\n    }\r\n  })\r\n\r\n  .state('orders.all', {\r\n      url: '/all',\r\n      views: {\r\n        'orders-all': {\r\n          templateUrl: 'templates/tab-chats.html',\r\n          controller: 'AllOrdersCtrl'\r\n        }\r\n      }\r\n    })\r\n .state('orders.settings', {\r\n    url: '/settings',\r\n    views: {\r\n      'app-settings': {\r\n        templateUrl: 'templates/settings.html',\r\n        controller: 'SettingsCtrl'\r\n      }\r\n    }\r\n  })\r\n\r\n  .state('orders.detail', {\r\n    url: '/:id',\r\n    views: { 'orders-list':{\r\n      templateUrl:'templates/order-detail.html',\r\n      controller: 'OrderDetailCtrl',\r\n      resolve: {\r\n        order: function($stateParams, $rootScope, OrderService){\r\n          // set the order on the rootScope\r\n          // prototypical inheritance finally pays off\r\n          $rootScope.order = OrderService.get($stateParams.id);\r\n        }\r\n      }\r\n  }\r\n}\r\n})\r\n   .state('login', {\r\n    url: '/login',\r\n    templateUrl: 'templates/login.html',\r\n    controller: 'LoginCtrl'\r\n    });\r\n```\r\n\r\nThe following code does not work as expected, exhibiting the behavior described above\r\n```\r\n $stateProvider\r\n\r\n     \r\n\r\n  // setup an abstract state for the tabs directive\r\n    .state('orders', {\r\n    url: \"/orders\",\r\n    abstract: true,\r\n    templateUrl: \"templates/tabs.html\",\r\n    // data property is inherited by child states\r\n    data: {\r\n      loginRequired: true\r\n    }\r\n  })\r\n\r\n  // Each tab has its own nav history stack:\r\n\r\n  .state('orders.list', {\r\n    url: '/list',\r\n    views: {\r\n      'orders-list': {\r\n        templateUrl: 'templates/tab-dash.html',\r\n        controller: 'OrderListCtrl'\r\n      }\r\n    }\r\n  })\r\n\r\n  .state('orders.all', {\r\n      url: '/all',\r\n      views: {\r\n        'orders-all': {\r\n          templateUrl: 'templates/tab-chats.html',\r\n          controller: 'AllOrdersCtrl'\r\n        }\r\n      }\r\n    })\r\n\r\n  .state('orders.detail', {\r\n    url: '/:id',\r\n    views: { 'orders-list':{\r\n      templateUrl:'templates/order-detail.html',\r\n      controller: 'OrderDetailCtrl',\r\n      resolve: {\r\n        order: function($stateParams, $rootScope, OrderService){\r\n          // set the order on the rootScope\r\n          // prototypical inheritance finally pays off\r\n          $rootScope.order = OrderService.get($stateParams.id);\r\n        }\r\n      }\r\n  }\r\n}\r\n})\r\n  .state('orders.settings', {\r\n    url: '/settings',\r\n    views: {\r\n      'app-settings': {\r\n        templateUrl: 'templates/settings.html',\r\n        controller: 'SettingsCtrl'\r\n      }\r\n    }\r\n  })\r\n   .state('login', {\r\n    url: '/login',\r\n    templateUrl: 'templates/login.html',\r\n    controller: 'LoginCtrl'\r\n    });\r\n```\r\n</span>\r\n\r\n<span is-issue-template></span>\r\n![screen shot 2015-05-08 at 3 44 48 pm](https://cloud.githubusercontent.com/assets/109041/7546950/441407bc-f599-11e4-94aa-52b60aa995d7.png)\r\n\r\nAccording to [ui-router documentation](https://github.com/angular-ui/ui-router/wiki/Nested-States-%26-Nested-Views#registering-states-order) states can be declared in any order"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic/issues/comments/111658298","html_url":"https://github.com/driftyco/ionic/issues/3689#issuecomment-111658298","issue_url":"https://api.github.com/repos/driftyco/ionic/issues/3689","id":111658298,"user":{"login":"Ionitron","id":6591344,"avatar_url":"https://avatars.githubusercontent.com/u/6591344?v=3","gravatar_id":"","url":"https://api.github.com/users/Ionitron","html_url":"https://github.com/Ionitron","followers_url":"https://api.github.com/users/Ionitron/followers","following_url":"https://api.github.com/users/Ionitron/following{/other_user}","gists_url":"https://api.github.com/users/Ionitron/gists{/gist_id}","starred_url":"https://api.github.com/users/Ionitron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ionitron/subscriptions","organizations_url":"https://api.github.com/users/Ionitron/orgs","repos_url":"https://api.github.com/users/Ionitron/repos","events_url":"https://api.github.com/users/Ionitron/events{/privacy}","received_events_url":"https://api.github.com/users/Ionitron/received_events","type":"User","site_admin":false},"created_at":"2015-06-13T02:38:43Z","updated_at":"2015-06-13T02:38:43Z","body":"Greetings @thebalaa!\n\nMy sensors indicate a reply was requested, but we have not received one yet, I am using my robot powers to close this issue. However, if you are still experiencing this issue, please feel free to reopen it by creating a new issue, and include any examples or necessary information.\n\nThank you for allowing me to assist you."}}