# Feature to close any opened $ionicPopup?

**URL:** <https://forum.ionicframework.com/t/feature-to-close-any-opened-ionicpopup/18525>\
**Category:** ionic-v1\
**Created:** [March 3, 2015, 1:01pm UTC](https://forum.ionicframework.com/t/feature-to-close-any-opened-ionicpopup/18525 "2015-03-03T13:01:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomatoKetchup](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@tomatoKetchup](https://forum.ionicframework.com/u/tomatoKetchup)\
**Post date:** [March 3, 2015, 1:02pm UTC](https://forum.ionicframework.com/t/feature-to-close-any-opened-ionicpopup/18525/1 "2015-03-03T13:02:00Z")

</div>

Hi there,

Very new JS/Angular/Ionic user here. Don’t know if my question is relevant but I’ll try.

In my app I have an inactivity timeout set, that logs out the user and sends him back to the Login state (this is set up as a controller in the app.js module, using a $rootscope).

If somewhere in the app I have an $ionicPopup opened, when the inactivity is detected, the app “resets” to the Login state but the $ionicPopup is still open. Because it was opened in a different state with a different scope, I cannot simply close it through my timeout function. And of course there could be one hundred different places where I’d open popups.

So I was wondering if there’s a simple way to detect any opened popup and close it from anywhere in the code, without having to deal with the scope?

Hope my question is understandable, if you need any additionnal info just ask for it.

Thanks for reading,  
Thomas

---

<div class="post-metadata">

**Author:** ![vool](https://avatars.discourse-cdn.com/v4/letter/v/ee7513/32.png) [@vool](https://forum.ionicframework.com/u/vool)\
**Post date:** [July 29, 2015, 12:35pm UTC](https://forum.ionicframework.com/t/feature-to-close-any-opened-ionicpopup/18525/2 "2015-07-29T12:35:23Z")

</div>

+1 for this feature, would be very handy

---

<div class="post-metadata">

**Author:** ![lochnguyen](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lochnguyen/32/92158_2.png) [@lochnguyen](https://forum.ionicframework.com/u/lochnguyen)\
**Post date:** [October 17, 2015, 8:49am UTC](https://forum.ionicframework.com/t/feature-to-close-any-opened-ionicpopup/18525/3 "2015-10-17T08:49:48Z")

</div>

+1 as well, this would be very useful

---

<div class="post-metadata">

**Author:** ![anees\_tricon](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anees\_tricon](https://forum.ionicframework.com/u/anees_tricon)\
**Post date:** [November 5, 2015, 5:12pm UTC](https://forum.ionicframework.com/t/feature-to-close-any-opened-ionicpopup/18525/4 "2015-11-05T17:12:09Z")

</div>

+100 for this feature.

---

<div class="post-metadata">

**Author:** ![Kashban](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/kashban/32/104500_2.png) [@Kashban](https://forum.ionicframework.com/u/Kashban)\
**Post date:** [December 29, 2015, 1:08pm UTC](https://forum.ionicframework.com/t/feature-to-close-any-opened-ionicpopup/18525/5 "2015-12-29T13:08:32Z")

</div>

could not agree more. +1
