var promise = GetQuestions.quote.get();
console.log(promise);
promise.$promise.then(function(quote) {
$scope.quotes = quote;
console.log($scope.quotes);
for( quote in $scope.quotes){
console.log(quote.cite);
}
});
factory
.factory('GetQuestions', ['$resource', function($resource){
return {
quote: $resource('**Resource Link**', {}, { get: { method: 'GET', isArray: true }})
};
}])
Here is console.log(promise):
[$promise: Promise, $resolved: false]
Here is console.log($scope.quotes):
And console.log(quote.cite) logs undefined
The Issue:
My issue is that I can't access the "cites", the promise is supposedly resolved however I can't seem to access the data correctly. I have tried doing promise.then() (instead of promise.$promise.then()), however I get an error telling me promise.then() is not a function. I am not sure why this is. Any help?