When going back using back button, the views dependencies are resolved again hitting the server a second time unnecessarily


#1

When the back button is pressed and the previous view uses resolve in ui-router to get data from the server, the view’s dependencies are resolved again, e.g. the loading message is shown and the server is hit for the data again, which 99.9% of the time hasn’t changed.

How can I make my App just go back and load the cached view without resolving the dependencies again?

Thanks,

My state

.state('app.home', {
  url: "/home",
  views: {
      'menuContent': {
          templateUrl: "templates/home.html",
          controller: 'HomeCtrl',

          resolve: {

            feed: function($q, Home, $ionicLoading) {

              $ionicLoading.show({
                template: 'Loading...'
              });

              var defer = $q.defer();

              var entry = Home.query(function() {
                $ionicLoading.hide();
                defer.resolve(entry[0]);
              })

              return defer.promise;

            }

          }

      }
  }
})