我总是很难设置 AngularJS 动画,要么是因为我还没有“理解” TM ,要么是因为命名法颠倒了。我确定是前者。
例如,以下 CSS 有效,即。元素在显示时从左侧飞入,并在隐藏时飞回左侧。
.fly-from-left {
transition:all linear 0.2s;
left:4px
}
.fly-from-left.ng-hide-remove { // this is the start point of the show animation
left: -20px;
}
.fly-from-left.ng-hide { // this is the endpoint of the hide animation
left: -20px;
}
但我不明白为什么负责显示动画的选择器被称为 ng-hide-remove。如果有人可以阐明命名法,我会发现将来设置动画要容易得多。