How can I animate Angular Material 2 dialog?

≡放荡痞女 提交于 2019-12-10 16:12:26

问题


How can I animate Angular Material 2 dialog?

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.

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

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?


回答1:


The dialog should be animating by default as seen here. Did you include BrowserAnimationsModule in your app?




回答2:


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




回答3:


You can see what i did here or install the module.



来源:https://stackoverflow.com/questions/45331324/how-can-i-animate-angular-material-2-dialog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!