user59759
user59759

Reputation: 159

what is the definition for Array.data in Angular.Js

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

Answers (1)

Wasif Khan
Wasif Khan

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

Related Questions