[英]How to disable ngx-bootstrap modal animation?
Is there a way to disable animation for ngx-bootstrap modal ? 有没有一种方法可以禁用ngx-bootstrap模态的动画?
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 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. 因为在某些情况下,模态在更复杂的网页中使用时显示的非常慢(大约在单击后2秒钟左右),所以禁用动画可能会更好。
Now you can disable animations only when using BsModalService. 现在,仅当使用BsModalService时,才能禁用动画。
Here's an example of its usage: 这是一个用法示例:
https://stackblitz.com/edit/ngx-bootstrap-k25ywj?file=app/app.component.ts https://stackblitz.com/edit/ngx-bootstrap-k25ywj?file=app/app.component.ts
this.modalService.show(template, {
animated: false
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.