Come posso chiudere il mio popup quando faccio clic su backgroud in ionico. Questo è il mio codice Sono nuovo a j ionico e angolare. Il codice qui sotto mi permette di aprire un popup e quando clicco sui pulsanti ho fatto chiudere il popup. Voglio farlo come quando clicco sullo sfondo dovrebbe portarmi alla home page.Come fare chiudere popup ionico quando si fa clic su sfondo
$scope.showPopup = function() {
$scope.data = {}
// An elaborate, custom popup
var myPopup = $ionicPopup.show({
title: 'Social Media Services',
scope: $scope,
buttons: [
{
type :'ion-social-facebook positive button-large',
onTap: function(e) {
// $cordovaSpinnerDialog.show("aaa", "aaaa");
window.open('https://www.facebook.com/BinDawood.Co', '_system', 'location=yes');
}
},
{ type :'ion-social-twitter calm',
onTap: function(e) {
// $cordovaSpinnerDialog.show("aaa", "aaaa");
window.open('https://twitter.com/BinDawoodco', '_system', 'location=yes');
}
},
{ type :'ion-social-pinterest assertive',
onTap: function(e) {
// $cordovaSpinnerDialog.show("aaa", "aaaa");
window.open('http://pinterest.com/bindawoodco', '_system', 'location=yes');
}
},
]
});
myPopup.then(function(res) {
console.log('Tapped!', res);
});
};
Come posso modificare il mio codice per farlo accadere?