0

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.

HDJEMAI
  • 9,436
  • 46
  • 67
  • 93
  • https://github.com/valor-software/ngx-bootstrap/issues/2554#issuecomment-326592680 Use service, not directive – EvgenyV Dec 20 '17 at 08:00

1 Answers1

5

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
});
HDJEMAI
  • 9,436
  • 46
  • 67
  • 93
IlyaSurmay
  • 2,283
  • 12
  • 20
  • 1
    ng-template modals are not usefull in a real app, there is no way to add any custom css style for them, the documentation is very limited. – HDJEMAI Dec 20 '17 at 23:18
  • If you need some functionality that isn't provided by lib, contact ngx-bootstrap team and request it. Slack - https://ngx-slack.herokuapp.com/ Github - https://github.com/valor-software/ngx-bootstrap – IlyaSurmay Dec 21 '17 at 10:04
  • is it also posible to disabled the animation from within the template ? – Johansrk Nov 08 '18 at 20:20