@LouisR wrote:
Hi
I have an action sheet to confirm the log out in my app. But it doesn't work well:
- there's only one option (logout), whereas there should be two (logout or cancel)
- 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(); }); } }); };
Posts: 5
Participants: 2