How to disable hiding pop-over when clicking on the appearance?

I would like to know how to prevent the pop-over from hiding when clicked from the outside? When clicked, a pop-up window is displayed. I need him not to hide after this. When I go beyond the limits of popularity, my pop-up skins hide. Is there a way to prevent this?

Codepen URL: http://codepen.io/anon/pen/WvYwqZ

$ionicPopover.fromTemplateUrl('my-popover.html', {
    scope: $scope
  }).then(function(popover) {
    $scope.popover = popover;
  });


  $scope.openPopover = function($event) {
    $scope.popover.show($event);
  };
  $scope.closePopover = function() {
    $scope.popover.hide();
  };

      

+3


source to share


1 answer


You need to add config backdropClickToClose

.

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

.controller('AppCtrl', function($scope, $ionicPopover) {
$ionicPopover.fromTemplateUrl('my-popover.html', {
    scope: $scope,
    "backdropClickToClose" :false
  }).then(function(popover) {
    $scope.popover = popover;
  });


  $scope.openPopover = function($event) {
    $scope.popover.show($event);
  };
  $scope.closePopover = function() {
    console.log("d");
    $scope.popover.hide();
  };


});

      



http://codepen.io/anon/pen/aOQZox

+6


source







All Articles