Hi guys! I’ve got an interesting issue here and i’m wondering if you all might be able to help me out.
I’ve got an application running that is using a ion-bar and ion-nav-view… in the first nav view i’m using an ng-repeat to run through an array return from an $http request…blah blah.
So here’s the issue! In order to persist the data once it’s been loaded already i implemented a $cacheFactory to store the data after the first time it’s loaded and check whether or not i already have it each time the view loads… ex:
if(fromCache == null){
pullPosts(url);
}else{
$scope.posts = [];
sortAssessments(fromCache);
}
Now i’m certain the logic here is fine because if i click another view in my app…say view 2 the $http request fires and i’m returned the data and the view populates…AND if i then click on view 1 the same thing happens. From which point on the data is cached and i can move between the two views without re-requesting it from the server…I’m stumped as to why when the application first launches i’m being presented with an empty view… I can provide more of the code if you all need it…
Any help would be greatly appreciated Thanks!