6

I have some old JavaScript libraries that use jQuery promises as return objects from function calls. I'm now using AngularJS which uses the $q service (inspired by the Q library). Does anybody have some generic JavaScript code to make these two different promise implementations compatible, so that jQuery promises can be used as if it where $q promises? Or something similar?

4

1 回答 1

21

第三方承诺可以被包装$q.when(thirdPartyPromise)成 $q 承诺。当thirdPartyPromise解决时, $q 承诺相应地解决并被$scope.$apply()调用。

于 2013-09-23T09:29:42.800 回答