简体   繁体   中英

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.

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
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM