AngularJS wrapper for async