How can I close the popup when I click on backgroud in ionic form. This is my code. I am new to ionic and angular js. The code below allows me to open a popup, and when I click the buttons I made, the popup closes. I want to do this as if I clicked on the background, it should have taken me to the home page.
$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); }); };
How can I change my code to make this happen?
source share