在 Angular 2 Material 中禁用动画 [英] Disable animation in Angular 2 Material

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

问题描述

我的问题是如何在角度材质小部件中禁用按钮或复选框动画?

My question is how we can disable button or checkbox animation in angular material widgets?

有一些 css 解决方案可以用 none 覆盖过渡,但它不起作用.

There are some css solutions to override transition with none but it s not working.

谢谢,

推荐答案

您可以使用 @.disabled 属性禁用动画,该属性在 angular 4.3.1.

You can disable animation using @.disabled property which is introduced in angular 4.3.1.

或者将以下代码添加到您的组件中

Either add below code to your component

@HostBinding('@.disabled') disabled = true

或在您的 html 中

or in your html

<div [@.disabled]="expression"></div>

这是工作 plnkr https://plnkr.co/edit/sVJM8H?p=preview

Here is working plnkr https://plnkr.co/edit/sVJM8H?p=preview

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

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