使用$ ionicLoading和模态视图的问题

时间:2014-09-01 11:20:16

标签: modal-dialog loading ionic-framework

我的应用程序发生了一些奇怪的事情。当我转到我的应用页面时,我正在使用$ ionicLoading来显示和隐藏加载模板。加载模板出现后,当前页面中的一切工作正常,但是如果我在当前视图中打开一个模态页面,它将被显示但我将无法与模态视图交互,一切似乎都冻结了。该应用程序继续运行,但我无法在模态中选择任何内容。我很确定$ ionicLoading是出现这个问题的原因,因为如果我消除它,一切正常。

那么,我怎么能解决它?

.controller('AppCtrl', function($scope, $ionicModal, $timeout, $http, $ionicPopover, $rootScope,$ionicLoading) {

 $ionicModal.fromTemplateUrl('templates/nuevoEvento.html', {
    scope: $scope,
     animation: 'slide-in-right'
  }).then(function(modal) {
    $scope.modalEvento = modal;
  });

  // Open the login modal
 $scope.evento = function() {
    $scope.modalEvento.show();
  };

 $scope.closeEvento = function() {
    $scope.modalEvento.hide();
  };

 $scope.showLoading = function() {
    $ionicLoading.show({
      template: 'Loading...'
    });
  };

  $scope.hideLoading = function(){
    $ionicLoading.hide();
  };
})


.controller('EventosCtrl', function($scope, $stateParams, $http, $timeout,$ionicLoading ) {

$scope.init=function(){
    $scope.showLoading();
    $http({method: 'GET', url: BASEPATH + '/eventos'})
      .success(function(data){
        $scope.hideLoading();
        $scope.eventos = data;
        console.log(data);
        var evLeft = [];
        var evRight = [];
        for(var i = 0; i < data.length; i = i + 2){
          evLeft.push(data[i]);
          if(data[i+1]){
            evRight.push(data[i+1]);
          }
        }
        $scope.tarjetasLeft = evLeft;
        $scope.tarjetasRight = evRight;

      })

1 个答案:

答案 0 :(得分:1)

你说你无法与模态视图互动。

尝试选项noBackdrop(甚至可能是hideOnStateChange

docs

的更多信息