如何为"Angular Material 2"对话框设置动画? [英] How can I animate Angular Material 2 dialog?

查看:39
本文介绍了如何为"Angular Material 2"对话框设置动画?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为Angular Material 2对话框设置动画?

How can I animate Angular Material 2 dialog?

我尝试使用普通的Angular 2+动画理论.它起作用了,但是发生的是对话框中的元素被激活(如预期的那样),并且对话框只是停留了下来.但是我想要的是对话框本身应该设置动画,例如,不透明度应该在几秒钟内从1变为0.

I tried using the normal Angular 2+ animation theory. it works, but what happens is the elements on the dialog get animated (as expected), and the dialog simply stays. But what I want is the dialog itself should animate, for example, the opacity should go from 1 to 0 in a couple of seconds.

我还检查了MdDialog.close()方法是否有任何动画选项,但是似乎没有.

I also checked whether the MdDialog.close() method has any options to animate, but there seems nothing.

常见的用例是使对话框的不透明度从1变为0(例如在关闭对话框之前),如何使用Angular Material 2对话框实现它?

Animating the opacity of a dialog from 1 to 0 (before closing it for example) is a common use case, how can I achieve it with Angular Material 2 dialog?

推荐答案

该功能尚不可用.您可以在此处跟踪状态.

This feature is not available yet. You can track the status here.

这篇关于如何为"Angular Material 2"对话框设置动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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