【发布时间】:2014-11-17 22:07:21
【问题描述】:
引用 $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
【问题讨论】:
-
先修正语法,
return { function(element) { ...没有意义。 -
已修复,非常感谢
标签: angularjs angular-promise angularjs-animation