This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Expose qFactory to enable a custom $q with a $scope-independent nextTick() #2993
Closed
Description
I'm having a hard time solving $q promises not correctly resolving out of AngularJS, in my case bridging back from Cordova/PhoneGap in a service.
- Using the
$rootScope.$apply
won't work, I hit the$digest already in progress
as I need several stacked calls when the app boot up (GoogleAnalytics init, PushNotifications, Udid retrieval, etc.). (actual code: https://github.com/mgcrea/angular-cordova/blob/master/src/angular-cordova.js#L37) $rootScope.$evalAsync
won't work, promise is never resolved.- Using
$timeout
works but is clearly suboptimal as it slows the bridge & triggers useless repaints.
It looks like several people encountered the same "broken promises" issue. Thus the idea of being able to define a custom $q that would behave more like the real $q for out of scope (usually in-services) operations.
Metadata
Metadata
Assignees
Labels
No labels