我一直在努力尝试在angular.js中尝试动画过渡动画,但没有成功。
ng-view有效,我可以在视图之间移动而没有问题,并且网址正确更新,但没有触发动画。
我的HTML是:
<div flex horizontal wrap layout>
<ng-view class="slide"></ng-view>
</div>
我的css(取自http://dfsq.github.io/ngView-animation-effects/app/#/code)是:
.slide {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.slide.ng-enter,
.slide.ng-leave {
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
.slide.ng-enter {
left: 100%;
}
.slide.ng-enter-active {
left: 0;
}
.slide.ng-leave {
left: 0;
}
.slide.ng-leave-active {
left: -100%;
}
我正在包含动画模块:
...
import 'package:angular/animate/module.dart';
import 'package:ch_padart/main_module.dart'; //Main Module set
void main() {
initPolymer()
.run(() {
applicationFactory()
.addModule(new NodeBindModule())
.addModule(new MainModule())
.addModule(new AnimationModule()) //<-- installed animation module
.run();
});
}
...