小程序wx:if过渡动画
Angular single page applications can be interactive and beautiful. The animations that can be used in Angular apps can help create the impression that it is a native phone or tablet application. We can bring animation to our Angular applications using the awesome ngAnimate module.
We've looked at how ngAnimate can helpAngular单页应用程序可以是交互式且美观的。 可以在Angular应用程序中使用的动画可以帮助创建它是本地电话或平板电脑应用程序的印象。 我们可以使用很棒的ngAnimate模块将动画带入Angular应用程序。
我们已经研究了ngAnimate如何帮助 animate ngView. Today we'll look at the simple way we can animate ngView动画 。 今天,我们将研究为 ngShow and ngHide directives. ngShow和ngHide指令设置动画的简单方法。The Technique
ngAnimate adds CSS classes when certain things change in your application. To explain this further, when animatingngView
, components enter and leave your application. ngAnimate adds the
.ng-enter
and
.ng-leave
classes. All we have to do is style (transitions or animations) to these using CSS classes.
ngShow and ngHide Classes
ForngShow
and
ngHide
, the classes that are added are
.ng-hide-add
and
.ng-hide-remove
.
Note that .ng-show isn't one of the classes.