参考 $animate api, $animation 自 angular1.3 起支持回调承诺。
但我的代码不起作用
angular.module('app', [ngAnimate])
.factory('test', ['$animate', '$q', function($animate, $q) {
return {
test: function(element) {
$animate.enter(angular.element("#node"), element)
.then(function() {
console.log('entered');
});
}
};
}]);
它回来了
Error: $animate.enter(...).then is not a function
我的角度和角度动画都是 1.3.0-beta.19
请帮忙!
编辑
我自己解决的问题。
因为自 v1.3.0-rc.0 起支持回调承诺,但不支持 v1.3.0-beta.19