Help in Loading

Please, I need help to use “Loading” in:

  • Start application and get data from remote server using $http, while get data I need show “Loading” and the when return data showing un input.

http://ionicframework.com/docs/angularjs/views/loading/

No work!!!, please help.

1 Like

Here’s a demo:

2 Likes

Thanks, work.

But , timeout should be finish the $http get json response

how could I do that?

$scope.showLoading = function() {

  	 $http({method: 'GET', url: 'http....'}).
      success(function(data, status, headers, config) {
        $scope.data = data;
      });
  
    $scope.loadingIndicator = $ionicLoading.show({
        content: 'Obtaining rate...',
        animation: 'fade-in',
        showBackdrop: false,
        maxWidth: 200,
        showDelay: 500
    }); 
    
    $timeout(function(){
      $scope.loadingIndicator.hide();
    },1000);   
  };

You can hide the loader in the $http promise (the then() function) after binding the response data to the scope.

$scope.data = data;
$scope.loadingIndicator.hide();

Perfect.

thank you very much. Work!!!