如何在angular2中制作页面过渡动画?
@Component({ selector:'myPagefirstPage',}) @View({ template: `<div class="view-animate ng-animate" > <h1>First Page</h1> </div>`
.view-animate.ng-enter {....}
但它不起作用@H_301_2@
从beta 15开始,基本过渡使用例如.ng-enter和.ng-enter-active作品.请注意,您必须将ng-animate类添加到动画元素.请参阅此plunkr以获取示例
http://plnkr.co/edit/WcH3ndMN0HOnK2IwOCev?p=preview
但是请注意,到目前为止不支持ng-leave,因为在动画完成之前删除了DOM节点(参见https://github.com/angular/angular/pull/6768)@H_301_2@