AngularJS - 动画NG-视图过渡 [英] AngularJS - Animate ng-view transitions
问题描述
我有2个HTML页面, welcome.html
和的login.html
这两者都是插入到 index.html的
通过 ngview
属性和路由器提供商 dependending的URL,如部分我AngularJS应用程序。
I have 2 html pages, welcome.html
and login.html
both of which are "inserted" into index.html
dependending on the URL via an ngview
attribute and router provider, as part of my AngularJS app.
这方面的例子可以在的AngularJS主页在网建立一个后端
An example of this can be found on the AngularJS home page under Wire up a Backend.
我的提问:有没有办法动画 welcome.html
和的login.html 过渡code>?
My question: Is there a way to animate the transition between welcome.html
and login.html
?
推荐答案
Angularjs 1.1.4现已推出了 NG-动画
指令,以帮助动画不同的元素,尤其是NG-视图。
Angularjs 1.1.4 has now introduced the ng-animate
directive to help animating different elements, in particular ng-view.
更新作为angularjs 1.2的,动画的工作方式发生了巨大变化,其中大部分是现在用CSS来控制,而无需设置JavaScript的回调,等等。你可以检查的更新武年教程。 @dfsq在不错的一套范例评论中指出。
UPDATE as of angularjs 1.2, the way animations work has changed drastically, most of it is now controlled with CSS, without having to setup javascript callbacks, etc.. You can check the updated tutorial on Year Of Moo. @dfsq pointed out in the comments a nice set of examples.
这篇关于AngularJS - 动画NG-视图过渡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!