0

Trying to get the event from ngx-bootstrap so I can prevent it from closing in certain cases

The documentation providing a reason but not an event, I assume I need the event to stop it? there is an example of static modal which has the event, I need to access the event using the modal service

This is what I been referring to

The static modal event which has the event

  this.modalService.onHide.subscribe((reason) => {
    const _reason = reason ? `, dismissed by ${reason}` : '';
    console.log(`onHide event has been fired `);
  })

Reason string only, no event!

I assume I can't prevent the user from closing the modal by stopping the onHide event?

et3rnal
  • 322
  • 4
  • 17

1 Answers1

0

As I this might be ngx-bs limitation? This is what I did:

(I don't consider this an answer to my question but rather a workaround)

I disabled drop off dismiss

ignoreBackdropClick: true, 

changed the close buttons from bsModalRef.hide() to my own function and use it to open another modal with a confirmation question

et3rnal
  • 322
  • 4
  • 17