Passing $q Defer Methods Around As Naked Function References In AngularJS

added by Robert Greyling
12/28/2014 9:44:28 AM


A few years ago, I noticed that the Deferred object methods, in jQuery, could be passed around as naked function references. Meaning, instead of passing around a closure that acted upon a deferred instance, I could simply pass around a reference to the "resolve" function. The AngularJS documentation doesn't mention this as a feature; but, I wanted to see if they've implemented the $q service with the same techniques in mind.