0

I have this in my controller right now, but it only shows the spinner for a second and then goes away, even though the content is still clearly loading

  $scope.$on("$ionicView.beforeEnter", function(event, data) {
      $ionicLoading.show({
      template: '<p>Loading...</p><ion-spinner></ion-spinner>'
    });
});


$scope.$on("$ionicView.afterEnter", function(event, data) {
      $ionicLoading.hide();
});

Any help would be appreciated. Thanks :)

MehdiN
  • 251
  • 4
  • 18
  • you mean the content of the things that you request through `$http`? The content that ionic is referring to is `viewContent` of angular, I think you mix up the two. – CozyAzure Dec 14 '16 at 02:07
  • I'm not sure what you mean, I do not request anything, just the images I use are very large and take a few seconds (maybe 2-3 secs) to load – MehdiN Dec 14 '16 at 02:48
  • the [`ionicView`](http://ionicframework.com/docs/api/directive/ionView/) refers to the `viewContent` of angular, and not on the onload of image being load. Angular (or Ionic for that matter) are yet to support this. What you could do is write a directive to handle the image onload event. http://stackoverflow.com/questions/17547917/angularjs-image-onload-event – CozyAzure Dec 14 '16 at 02:53
  • Awesome...I'll take a look. Thanks :) – MehdiN Dec 14 '16 at 03:09

0 Answers0