Reputation: 159
I have a code like below :
var territories = {};
if(territories.data) {
deferred.resolve(angular.copy(territories));
} else {
endpoints.getAllTerritories().then(function(resp) {
console.log(resp);
territories = resp;
deferred.resolve(territories);
});
}
Can anyone give defintion of how Array.data is used, like here in the code we see territories.data
. It simple seems like checks if the array has data or not, but I need to know the exact definition and if possible any documentation link for the same
Upvotes: 0
Views: 52
Reputation: 954
In your code, territories is not array, it is JSON, which is Javascript Object Notation. Try exploring JSON instead of Array.data.
Upvotes: 1