A wrapper for Angular's Deferred and Promise APIs