Issues with action sheet

Hi

I have an action sheet to confirm the log out in my app. But it doesn’t work well:

  1. there’s only one option (logout), whereas there should be two (logout or cancel)
  2. when I click on “logout” the action sheet doesn’t close itself.

controllers.js:

$scope.showLogOutMenu = function() {
    var hideSheet = $ionicActionSheet.show({
      titleText: 'Are you sure you want to logout?',
      buttons: [
        { text: '<i class="icon ion-log-out balanced"></i> Logout' },
        { text: '<i class="icon ion-close-circled assertive"></i> Cancel' },
      ],
      destructiveText: 'Logout',
      cancelText: 'Cancel',
      cancel: function() {},
      buttonClicked: function(index) {
        return true;
      },
      destructiveButtonClicked: function(){
        $ionicLoading.show({
          template: 'Logging out...'
        });

        // Facebook logout
        facebookConnectPlugin.logout(function(){
          $scope.facebookButtonShow = true;
          $scope.googleButtonShow = true;
          $ionicLoading.hide();
        },
        function(fail){
          $ionicLoading.hide();
        });
      }
    });
  };

You need to return true on destructiveButtonClicked to close, or false to keep it open.

See in the bottom of this page:
http://ionicframework.com/docs/api/service/$ionicActionSheet/

Ok thanks for this. I see now.

But how come I can’t see the ‘cancel’ button ?

Doesn’t know yet, but since the action sheet already have a cancel button configured you can remove this line, you don’t need it, see in the example of the documentation page.
{ text: '<i class="icon ion-close-circled assertive"></i> Cancel' },

Can you put a fiddle of your code, or codepen?? It’s better to figure out what is happening.

There not much to put in codepen, I mean that’s just the code I posted in the question you know.
I rmeoved the line you mentionned, but now I don’t have any “cancel” button…