当我点击离子背景时,如何让我的弹出窗口关闭.这是我的代码.我是离子和角度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 /