【问题标题】:ngx-modals catch event when modals is closed?当模态关闭时,ngx-modals 捕获事件?
【发布时间】:2020-01-21 02:09:33
【问题描述】:

我正在使用 ngx-modals,当模式打开时我添加一个布尔值,我将它设置为“true”,当模式关闭时我希望它为“false”。无论我使用 Escape 键,单击 X 按钮或单击背景关闭模式。如何让它成为可能?

openFoodDetail(template: TemplateRef<any>) {
 this.modalRef = this.modalService.show(
  template,
  Object.assign({}, { class: 'modal-lg modal-dialog-centered' },)
 );
 this.modalsState = true;
}

当我的模态框关闭时,我可以捕捉或制作事件吗?

【问题讨论】:

    标签: angular typescript modal-dialog ngx-bootstrap


    【解决方案1】:

    您可以在模板中使用 onHide 事件。

    请看下面的链接:

    https://valor-software.com/ngx-bootstrap/#/modals#directive-events

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-04
      • 2010-11-25
      • 2010-11-04
      • 1970-01-01
      • 2013-01-05
      • 1970-01-01
      相关资源
      最近更新 更多