rubenv / angular-rt-popup

A better version of the Bootstrap popover, for Angular.JS
MIT License
22 stars 14 forks source link

Popover is not hidden when state changes #18

Closed hmartos closed 9 years ago

hmartos commented 9 years ago

The problem is that popover is not hidden when state changes (I am using ui-router, but I suppose it will also happen when using ngRoute). For example, I open my popup by pressing a help button showing some info to a user, and if I doesn't close the popup by clicking the close button or clicking in any other place in the screen and I click in my menu performing a state change, the popup remains in the screen in the new state.

Thank you!

Kukunin commented 9 years ago

:+1:

rubenv commented 9 years ago

Here's something you can add to your application right now:

$rootScope.$on("$stateChangeStart", function () {
    Popup.close();
});
hmartos commented 9 years ago

Works perfectly, thank you!! Just remember that you must include Popup factory in the run method to have this code working.