[英]Call a function on bootstrap modal close(Both through escape button and any other way) in angular
I am working with angular.我正在使用 angular。 I have Bootstrap modal popup.
我有Bootstrap模式弹出窗口。 I have called a function when its gets closed.
当它关闭时,我已经调用了 function。 But the problem is there are other ways to close like pressing escape button or simply clicking on the screen.
但问题是还有其他关闭方式,比如按下退出按钮或简单地点击屏幕。 I don't know how to call the same function when these events like escape occur?
当这些事件如逃逸发生时,我不知道如何调用相同的 function? I have googled stackoverflow and couldn't find a proper solution.
我用谷歌搜索了stackoverflow,找不到合适的解决方案。
You can use the blur
event of your modal element.您可以使用模态元素的
blur
事件。 And onBlur
do whatever you want to.并且
onBlur
做任何你想做的事。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.