jquery – 单击背景时如何关闭离子弹出窗口

当我点击离子背景时,如何让我的弹出窗口关闭.这是我的代码.我是离子和角度js的新手.下面的代码允许我打开一个弹出窗口,当我点击按钮时,我弹出了弹出窗口.我想这样做,因为当我点击背景它应该让我到主页.
$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',"aaaa");
        window.open('https://twitter.com/BinDawoodco',{  type :'ion-social-pinterest assertive',"aaaa");
         window.open('http://pinterest.com/bindawoodco',]
 });
 myPopup.then(function(res) {
  console.log('Tapped!',res);
 });

 };

如何修改我的代码才能实现这一目标?

解决方法

如果你想关闭背景的ui,那么使用modal而不是popup.
希望这能解决你的问题.

http://ionicframework.com/docs/api/service/ $ionicModal /

相关文章

jQuery表单验证提交:前台验证一(图文+视频)
jQuery表单验证提交:前台验证二(图文+视频)
jQuery如何实时监听获取input输入框的值
JQuery怎么判断元素是否存在
jQuery如何实现定时重定向
jquery如何获取复选框选中的值