Search code examples
angularanimationngx-bootstrapngx-bootstrap-modaldisable

How to disable ngx-bootstrap modal animation?


Is there a way to disable animation for ngx-bootstrap modal ?

I've tried to add this config but it's not working:

config = {
  animated: false,
  backdrop: 'static'
};

Demo:

https://stackblitz.com/edit/ngx-bootstrap-cwfhnu?file=app%2Fmodal-component%2Fstatic-modal.component.html

The modal is still showing animated.

Because in some cases the modal is showing very slow when used in a more complex web page (something like 2 seconds after a click), so may be it will be better when disabling the animation.


Solution

  • Now you can disable animations only when using BsModalService.

    Here's an example of its usage:

    https://stackblitz.com/edit/ngx-bootstrap-k25ywj?file=app/app.component.ts

    this.modalService.show(template, {
       animated: false
    });