AngularJS – why is $apply required to properly resolve a $q promise?
In AngularJS the results of resolve() are propagated asynchronously, inside a $digest cycle, not immediately. This means that callbacks registered with then() will only be called (later) when a digest cycle occurs. In your code, nothing is causing Angular to enter a digest cycle, so the then() callback is never called. Calling $apply() is one … Read more