2016-04-09 82 views
0

在我的離子框架上點擊提交按鈕打開一個確認彈出窗口。離子點擊確認彈出按鈕打開另一個彈出

我想要點擊是的!button顯示另一個類似的彈出窗口。如何通過單擊一個彈出式按鈕來定位另一個彈出窗口。

查找Codepen Demo

我的控制器下面的代碼:

.controller('PopupCtrl', function($scope, $ionicPopup){ 
    //confirm Number 
    $scope.confirmNumber = function(){ 
     var confirmPopup = $ionicPopup.confirm({ 
      title: 'NUMBER CONFIRMATION:', 
      template: '<span class="numberConfirm">+91 9820098200</span>Is your phone number above correct?', 
      buttons: [{ 
       text: 'Edit', 
       type: 'button-block button-outline button-stable', 
       scope: null, 
       onTap: function(e) { 

       } 

      }, { 
       text: 'Yes, it is!', 
       type: 'button-block button-outline button-stable', 
       onTap: function(e) { 

       return scope.data.response; 
       } 
      }] 
     }); 
     confirmPopup.then(function(res){ 
      if(res){ 

      }else{ 

      } 
     }); 
    }; 
}); 
+0

怎麼樣有內部'confirmPopup.then另一個彈出代碼( '功能? –

+0

如何做到這一點。?我是不理解那.. – locateganesh

回答

2

我終於得到了解決:

codePen Demo

angular.module('mySuperApp', ['ionic']) 

.controller('PopupCtrl', function($scope, $ionicPopup){ 
    //confirm Number 
    $scope.confirmNumber = function(){ 
     var confirmPopup = $ionicPopup.confirm({ 
      title: 'NUMBER CONFIRMATION:', 
      template: '<span class="numberConfirm">+91 9820098200</span>Is your phone number above correct?', 
      buttons: [{ 
       text: 'Edit', 
       type: 'button-block button-outline button-stable', 
       scope: null, 
       onTap: function(e) { 

       } 

      }, { 
       text: 'Yes, it is!', 
       type: 'button-block button-outline button-stable', 
       onTap: function(e) { 
        $scope.showAlert(); 
       } 
      }] 
     }); 
     confirmPopup.then(function(res){ 
      if(res){ 

      }else{ 

      } 
     }); 
    }; 

    // permissions 
    $scope.showAlert = function() { 
     var alertPopup = $ionicPopup.alert({ 
      title: 'we would like yo access', 
      template: '<i class="ion-android-contacts"></i> Contact <br/> <i class="ion-android-locate"></i> Location', 
      okType: 'button-block button-outline button-stable', 

     }); 
     alertPopup.then(function(res) { 
      console.log(45); 
     }); 
    }; 

}); 
相關問題