1

我正在写一个 ng 动画,但它似乎效果不佳,这就是我所拥有的:

app
.animation('notification-enter', ['$timeout',function($timeout) {
  return {
    setup : function(element) {
      $(element).addClass('hide');
    },
    start : function(element, done, memo) {
      $(element).slideDown();
    },
    cancel : function(element, done) {
    }
  };
}])
.animation('notification-leave', ['$rootScope', function($rootScope) {
  return {
    setup : function(element) {
    },
    start : function(element, done, memo) {
      // at this moment, the item is removed so we cannot do the slideUp effect.
      $(element).slideUp();
    },
    cancel : function(element, done) {
    }
  };
}]);

我不知道这是否是使用 ngAnimate 实现效果的正确方法。在上面的代码中,我只在删除一个项目时遇到问题,在start()函数中,该项目已经被删除。

所以问题是如何slideUp()使用 ngAnimate 正确实现项目删除?

4

0 回答 0