When using the deferred method offered by angularjs and querying the database local storage, the "resolve" doesn't seem to work. See the following example. The "then" action is never fired. When trying with a setTimeout instead of the "Person.all()" instruction, it works.
var defer = $q.deferred();
Person.all().list(null, function (persons) {
defer.resolve(persons);
});
defer.promise.then(function (persons) {
console.log('resolved');
});
Thanks for helping.