使用相同的ui视图时的角度ng-animate

时间:2014-10-14 17:10:37

标签: angularjs angular-ui-router ng-animate

在父模板中,我指定应该出现子视图的ui-view,我还包括动画,如下所示:

<div class="am-fade-and-slide-bottom" ui-view></div>

所以我想在这个视图中放置十个东西时出现动画。它的工作原理!如果我删除那个ui-view(好吧,在使用ui-router时转到之前的状态),我会得到隐藏该视图的动画。

问题是,当我改变ui-view的内容时,我会重复隐藏和显示的动画,虽然我想这次没有动画(因为我在模板上有加载指示符)进入ui-view)。

我该怎么做?


这是来自Angular Motion library

的课程.am-fade-and-slide-bottom
.am-fade-and-slide-bottom {

  animation-duration: @fade-and-slide-duration;
  animation-timing-function: @fade-and-slide-timing-function;
  animation-fill-mode: backwards;

  &.am-fade-and-slide-bottom-add, &.ng-hide-remove, &.ng-move {
    animation-name: fadeAndSlideFromBottom;
  }
  &.am-fade-and-slide-bottom-remove, &.ng-hide {
    animation-name: fadeAndSlideToBottom;
  }

  &.ng-enter {
    visibility: hidden;
    animation-name: fadeAndSlideFromBottom;
    animation-play-state: paused;
    &.ng-enter-active {
      visibility: visible;
      animation-play-state: running;
    }
  }
  &.ng-leave {
    animation-name: fadeAndSlideToBottom;
    animation-play-state: paused;
    &.ng-leave-active {
      animation-play-state: running;
    }
  }

}

0 个答案:

没有答案