Search code examples
angularjsangular-strap

How to watch for an Aside closing in angular-strap


I'm using angular-strap to show an Aside, and want to react to the user closing it (to cancel a background computation). This can easily be done if the user clicks on x or the close-button I added, but the user can also close the aside by clicking on the grayed-out background.

Is there any generic method to watch for the Aside closing?

$destroy is not emitted on the scope.


Solution

  • You can listen for 'modal-hide' event:

    $scope.$on('modal.hide', function() {
      console.log('modal-hide');
    });
    

    check out that plunker: http://plnkr.co/edit/f6l0KBMiSsknRpeXLo9P