I'm trying out some Angular and I can't seem to get my head around $scope objects.
I don't seem to be able to easily loop through a scope objects child. I have a match object, which has players where I want to loop through to get their points.
app.controller('PlayController', function($scope, Points, Matches, $routeParams, $location){
var id = $routeParams.id;
$scope.match = Matches.get({id: id});
angular.forEach($scope.match.players, function(value, key) {
console.log(value);
console.log("test");
});
});
Nothing is returned here, no value or test and I'm sure $scope.match has 3 players in there.
Anyone any idea what I'm doing wrong here?