问题
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