Hello guys, I think I’ve found a little but annoying bug when using nested states in tab subviews…
If I use a nested state in the first tab, it works perfectly, reloads well and if it’s the default route it runs well. But if I try to use a nested state in the second tab, it doesn’t load if it’s the initial url or if I reload it (it’s the same), it only works if I navigate to another tab and then back to it.
In my app I have a main abstract state for the tabs, as in the starter project:
.state('tab', {
url: "/tab",
abstract: true,
templateUrl: "templates/tabs.html"
})
And then two abstract states to nest more states to them:
.state('tab.user', {
url: '/user',
abstract: true
})
.state('tab.search', {
url: '/search',
abstract: true
})
Then I have some other states nested to the abstract ones:
.state('tab.search.form', {
url: '/list',
views: {
'search-tab@tab': {
templateUrl: 'templates/search.html'
}
}
})
.state('tab.user.profile', {
url: '/profile',
views: {
'user-tab@tab': {
templateUrl: 'templates/profile.html'
}
}
})
The /tab/search/form is the first tab and works ok, and loads ok if it’s the default or first url the app loads (it refreshes ok). The /tab/user/profile is the second tab and works ok if you enter to it after loading the app in another tab, if you try to load this url directly it doesn’t works well. It loads the tab bar but with the first tab selected instead of the second, and no view or title bar appears.
If I switch the order of the tabs in the tabs.html the problem switches from one view to another, the profile one works perfectly and the search begins to fail.
I’ve tried to figure why, debugging the Ionic code, but I’m totally lost for this one. Some help will be appreciated.
Thanks!