I want to return promises from my module/sdk to non-angular javascript. For example if I'm returning promise to a jquery, I should be probably sending jquery deferred object. How can I convert an Angular promise to a jquery promise/deferred obj.
Any suggestions are much appreciated.
Disclaimer: jQuery promises don't play nice with other libraries - at all. jQuery will not assimilate other third party promises on its own. Angular $q promises on the other hand - will, so whenever you have the choice, assimilate the jQuery promise into an Angular promise and not vice versa. (All this changes in jQuery 3.0, if you see this disclaimer and 3.0 has already been released - please leave a comment).Converting a jQuery promise into an Angular promise:
Converting a jQuery promise to a native or Bluebird promise:
Converting a Promises/A+ complaint promise like $q Angular promise or Bluebird promise or native promises into jQuery promises:
Also worth noting - Angular promises can consume jQuery promises: