angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

$animator's animate(el) could (should) return a promise

Open iuliust opened this issue 13 years ago • 3 comments

this isn't really an issue, but I'm new to gitHub and I do not know where I should share this idea. Sorry for that. instead of returning nothing, it could return a promise. So we could do in a directive something like : var animator = $animator(scope, attrs); animator.animate('firstCustomAnimationEvent', el) .then(function(){ doSomething(); animator.animate('secondCustomAnimationEvent', el); }); the animate function could wait for the animation to finish to return the promise. Wouldn't it be awesome ? Maybe there's already a way to do just that but I can't figure it out for now.

iuliust avatar Aug 03 '13 14:08 iuliust

1.2 supports callbacks. But the callbacks for now are temporary feature until promises are taken out of the $scope and $digest cycle. Then a promise can be returned that isn't dependent on the internals of AngularJS. That's the plan.

matsko avatar Sep 05 '13 17:09 matsko

OK, thank you a lot matsko !

iuliust avatar Sep 09 '13 19:09 iuliust

Closing this for now. This is definitely in the plans for 2.0.

matsko avatar Oct 01 '13 19:10 matsko