我在将动画应用到ng-view时遇到了困难。 ng-enter和ng-leave类似乎从未应用于视图。这种行为似乎与没有动画一样。有没有办法验证动画功能是否真的有效,所以我可以判断这是我的代码有问题还是角加载的方式?
HTML:
<div ng-view class="fade"></div>
的CSS:
.fade {
opacity: 1;
}
.fade.ng-enter,
.fade.ng-leave {
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
.fade.ng-enter {
opacity: 0;
}
.fade.ng-enter-active {
opacity: 1;
}
.fade.ng-leave {
opacity: 1;
}
.fade.ng-leave-active {
opacity: 0;
}