Folks,
I have my code setup somewhat as below:
$scope.init = function(){
return $q.all([resource1.query(),resource2.query(),resource3.query()])
.then(result){
$scope.data1 = result[1];
$scope.data2 = result1[2];
$scope.data3 = result[3];
console.log(data1); //prints as [$resolved: false, $then: function]
doSomething($scope.data1,$scope.data2);
}
}
I was under the impression that the "then" function will be called only when all the resources get resolved. However this is not what I am seeing in my code. If I print data1, I get unresolveed.
Any clue as to what I am missing here ??