2016-04-09 2 views
0

In meinem ionischen Rahmen auf klicken Sie auf senden Schaltfläche ein Bestätigungsdialogfeld öffnet sich.Ionic on click bestätigen Popup-Taste öffnen Sie ein weiteres Pop-up

Ich möchte auf Klick von Ja ist es!button zeigen ein weiteres ähnliches Popup. Wie kann ich mit einem Klick auf einen Popup-Button ein anderes Pop-up ansteuern?

Finden Codepen Demo

mein Controller-Code unten:

.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

wie etwa innerhalb 'confirmPopup.then einen weiteren Popup Code ('Funktion? –

+0

Wie geht das.? Ich bin verstehe das nicht .. – locateganesh

Antwort

2

Ich habe endlich Lösung:

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

});