Organizational Research By

Surprising Reserch Topic

how to close pop up screen when click out side in screen


I make one pop up screen I open pop up screen on button screen .I want to hide pop up screen when I click outside the screen can is this possible ?

code http://codepen.io/anon/pen/KpLgpm

angular.module('ionic.example', ['ionic'])

  .controller('PopupCtrl', function($scope, $timeout, $q, $ionicPopup) {
      $scope.showPopup = function() {
        $scope.data = {}
        $scope.setDefault = function () {
         console.log('Default set', arguments);
          $scope.$onClose({ test: 'hello' });
        };
        $scope.btns = [
          {
            label: "Hi",
            value: "hi"
          },
          {
            label: "Hello",
            value: "hello"
          }
        ];

        $ionicPopup.show({
          template: '',
          title: 'Pick a default value',
          scope: $scope,
          buttons: [
            {
              text: 'Awesome',

              onTap: function(e) { return 'awesome'; }
            },
            { text: 'Cool', onTap: function(e) { return 'cool'; } },
            { text: 'Cooler', onTap: function(e) { return 'cooler'; } },
            { text: 'Stuff', onTap: function(e) { return 'stuff'; } }
          ]
          }).then(function(res) {
            console.log('Tapped!', res);
          }, function(err) {
            console.log('Err:', err);
          }, function(msg) {
            console.log('message:', msg);
          });

      };

  });
asked Aug 17, 2015 in JAVASCRIPT by rajesh
0 votes
37 views



Related Hot Questions



Government Jobs Opening


...