How to watch for an Aside closing in angular-strap

时光总嘲笑我的痴心妄想 提交于 2019-12-08 04:07:05

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/25531410/how-to-watch-for-an-aside-closing-in-angular-strap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!