How to open ionicPopup on click of ionicActionSheet option?

I am attempting to open a popup when the user hits the 'custom' button on an actionsheet and I cannot figure out how to interact between the two. My best guess is below, as when I call ng-click="showPrompt()" in the view, the popup is triggered, but when I try to do it from within the buttonClicked event on the actionsheet, it's a no-go.

.controller('TablesCtrl', function($scope, $ionicPopup, $ionicActionSheet) {
    $scope.tables = [];

    /* Choose Number of Guests */
    $scope.showActionsheet = function($ionicPopup) {
        $ionicActionSheet.show({
          titleText: 'How many guests?',
          buttons: [
            { text: '1' },
            { text: '2' },
            { text: '3' },
            { text: '4' },
            { text: '5' },
            { text: '6' },
            { text: 'Custom' }
          ],
          cancelText: 'Cancel',
          cancel: function() {
            console.log('CANCELLED');
          },
          buttonClicked: function(index, $ionicPopup) {
            console.log('BUTTON CLICKED', index);
            if(index==6){showPrompt();}
            return true;
          }
        });
      };
    /* CUSTOM Number of Guests */
    $scope.showPrompt = function() {
        var myPopup = $ionicPopup.show({
        template: '<input type="password" ng-model="data.wifi">',
        title: 'Enter Wi-Fi Password',
        subTitle: 'Please use normal things',
        scope: $scope,
        buttons: [
          { text: 'Cancel' },
          {
            text: '<b>Save</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;
              }
            }
          },
        ]
      });
    };
})

Try using $scope because that function is undefined in that context but $scope is defined via closure:

if(index==6){$scope.showPrompt();}