0

So an ionic popup has a number of different components, such as popup-title, popup-head, popup-body, etc, etc.

What I'm trying to do is dismiss the notification on both the click of the popup-head element and on anywhere outside the popup, but I can't seem to figure out how.

I'm capable of overriding the CSS for both, the background can be overridden by styling .popup-container, but I have no clue as to how to add an ng-click to them.

Any help appreciated.

Mr.P
  • 1,390
  • 13
  • 35
  • There's no fiddle link, because I don't have any idea how to write it. – Mr.P Oct 06 '15 at 11:14
  • or the relevant parts of your code so far in the end of question. – mico Oct 06 '15 at 11:15
  • I haven't tried this, but can you add an ng-click to the body element or the wrapper div? Also this might be relevant: http://stackoverflow.com/questions/20186438/angular-click-outside-of-an-element-event – Luke Oct 06 '15 at 11:58

1 Answers1

0

Install npm package:

bower install angular-clickout

Use in your code/div/element:

<div click-out="hide()"></div>

Source: https://www.npmjs.com/package/angular-clickout

I believe you can use any function inside your controller for click-out. So you can customize the behaviour.

Luke
  • 1,768
  • 2
  • 20
  • 30