在 Angular Material 2 中禁用动画,但在应用程序的其余部分继续使用动画 [英] Disable animations in Angular Material 2 but keep using animations in the rest of the application

查看:21
本文介绍了在 Angular Material 2 中禁用动画,但在应用程序的其余部分继续使用动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁用 Angular Material 2 的所有动画,但是当我导入 NoopAnimationsModule 时,它也会阻止我在我的应用程序代码的其余部分中使用 Angular Animation 模块.我希望能够为我的应用程序的某些内容设置动画,但禁用 Angular Material 2 的动画.有人知道怎么做吗?

I want to disable all the animations to the Angular Material 2, but when I import the NoopAnimationsModule it also prevents me for using the Angular Animation module in the rest of my app code. I'd like to be able to animate certain things of my app, but disable the animation for Angular Material 2. Does anyone know how to do that?

我想禁用除涟漪效应之外的所有动画.

I want to disable all the animations but the ripple effect.

推荐答案

部分材质组件提供 api 来禁用涟漪效应.据我所知,完全关闭material2的动画是不可能的.

Some of the material components provide api to disable ripple effect. As far as I know, it's not possible to completely turn off animation for material2.

disableRipple 属性可用于

  • 复选框
  • 收音机
  • 按钮
  • 滑块切换
  • 标签
  • 按钮

这篇关于在 Angular Material 2 中禁用动画,但在应用程序的其余部分继续使用动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆