Ionic AngularJs Inconsistent Navigation


#1

Hi, I’ve used the ionic tabs sample to create a basic app, where I display a list of results in one tab, and the details of a selection in the other tab. This works fine most of the time and I can see the hash fragment value change correctly to #tab/games/companyname/0 and when I click on the back button, the hash value changes back to #tab/games

The problem is, in some instances (the issue seems to occur when the data size is larger), on back click, the hash value does not change to #tab/games despite the initial list view tab being shown for a brief moment, after which the view shown before back button was shown is displayed.

If you keep on clicking the back button, the hash value is eventually correct and the list view is displayed.

The same issue happens other way around when trying to navigate from the list view to detail view -> #tab/games to #tab/games/companyname/0

If I override the hash value to what it should be inside a handler for the $ionicView.enter event, then, the wrong view still flashes but eventually the correct view is shown.

I’ve now hardcoded a data set of 5 results to try and identify when the issue begins and it seems that it does not happen for 5 items, but for 30 items, even if the data is hardcoded(not retrieved using an http request), the issue still happens.

Does any one have any ideas around what may be causing this issue?

 $stateProvider
 .state('tab', {
      url: '/tab',
      abstract: true,
      templateUrl: 'templates/games.html'
  })

.state('tab.games', {
    url: '/games',
    views: {
        'tab-games': {
            templateUrl: 'templates/tab-games.html',
            controller: 'GamesCtrl'
        }
    }
})
  .state('tab.game-detail', {
      url: '/games/:SourceId/:GameIndex',
      views: {
          'tab-news': {
              templateUrl: 'templates/game-detail.html',
              controller: 'GameDetailCtrl'
          }
      }
  });

https://github.com/driftyco/ionic-starter-tabs