Cache view when using back button , no cache otherwise.
This will keep the scroll position when going back but bring to TOP of a new list when entering the view from a menu/ other ways similar to “forward”.
I see a lot of questions pertaining to keeping the scroll position (just enable cache) but what about when you want to reload data: for me , it keeps the scroll position and looks bad when going “forward” into the view instead of going “back” with the back button!
Anyone else has this problem?
for now i must do (with the help of state.eqpEligibleLoaded which i set when the http call finishes loading the data) :
$scope.$watch(function () { return state.eqpEligibleLoaded; }, function (newVal, oldVal) {
if (typeof oldVal !== 'undefined' && newVal !== 'undefined' && newVal !== oldVal ) {
$ionicScrollDelegate.resize();
// $ionicScrollDelegate.scrollTop(); // <-- this gives error "scrollTo undefined"
}
});