I can currently display the desired values in text in the DOM:
<li id="dates" class="dates" ng-repeat="(key,value) in players">
{{value.Session_Date}}
</li>
I need each of the values that is repeated to be accessible, so that each can be pushed to an array. I have tried many different things like different variations on array.push(angular.element('#dates').scope());
and nothing has worked. Is the problem the data itself? $scope.players is assigned to a returned array of documents from mongoDB, queried using the following server side code:
collection.find().toArray(function(er,docs){
if(err) { return console.dir(err); }
res.send(docs);
the 'Session_Date' is an inner JSON value of a particular document. These inner values need to be accessible.
EDIT: I'll be clearer:
The query is accessed with an AJAX call in the service:
app.factory('dates', ['$resource', function($resource) {
return $resource('/orders/api/dates', {}, {
get: {
isArray: true
}
});
}]);
Which is called in the controller:
app.controller('PlayersController', ['$scope', 'api', '$rootScope', function($scope, api, $rootScope) {
api.get(function(data) {
$scope.players = data;
});
}]);