Ionic点击确认弹出按钮打开另一个弹出窗口



在我的离子框架中,单击提交按钮,会打开一个确认弹出窗口。

我想点击是的button显示另一个类似的弹出窗口。我如何在点击一个弹出按钮时瞄准另一个弹出窗口。

查找Codepen演示

我的控制器代码如下:

.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{
            }
        });
    };
});

我终于得到了解决方案:

codePen演示

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);
        });
    };
});

相关内容

  • 没有找到相关文章