ionicPopup, no buttons?


#1

I have an ionicPopup where it shows two options … can you delete the buttons and that when you click on one of the two options, will the popup automatically close? I say to save the step of pressing the ok button

some example? thanks!!


#2

are you talking about like this?

var alertPopup = $ionicPopup.show({
      template: '<input type="text" ng-model="data.wifi">',
      title: 'Wifi',
      subTitle: 'Please enter wifi password.',
      buttons: [
      { text: 'Cancel' },
      {
      text: '<b>Enter</b>',
      type: 'button-positive',
      onTap: function(e) {
      if (!$scope.data.wifi) {
      //don't allow the user to close unless he enters wifi password
          e.preventDefault();
        } else {
          return $scope.data.wifi;
         }
      }
     },
    ]

#3

I want you to select the two options and do not have to press the OK button and popup close


#4

I don’t get it, can you clarify what you want to achieve?


#5

Example: Choose a console:

PS4

XBOX ONE

Ok Cancel

1.- I usually choose an option and then press OK and the popup closes.

What I want to do is to choose an option and close the popup automatically and remove the ok and cancel buttons


#6

just add the myPopup.close(); whenever you click to any radio buttons…


#7

:smiley: yes right! thanks!!:grin:


#8

glad that I help… happy coding…