AngularJS to jQuery promise converter