I have a controller that, through Parse, successfully retrieves and pushes an object onto an array as so:
var mySite = angular.module('mySite', []);
mySite.controller('listConnectors', ['$scope',
function ($scope) {
//Parse.initialize here;
$scope.array = [];
var TestObject = Parse.Object.extend("TestObject");
var query = new Parse.Query(TestObject);
query.find({
success: function (results) {
alert("Successfully retrieved " + results.length + " rows.");
// Do something with the returned Parse.Object values
for (var i = 0; i < results.length; i++) {
var object = results[i];
alert(object.id + ' - ' + object.get('foo') + " " + object.get('num'));
/***** Pushing onto array here *******/
$scope.array.push(object);
}
console.log($scope.array[0].attributes.foo); //Grabbed what was needed
},
error: function (error) {
alert("Error: " + error.code + " " + error.message);
}
});
}]);
I am then, unsuccessfully, trying to loop and list the "foo" value of every object in the array, as the console.log above shows. However, nothing is outputted. It's as though, possibly, the ng-repeat is not being executed or entered:
<li ng-repeat="eachElement in array">
<a > {{eachElement.attributes.foo}}</a>
</li>
Any help would be appreciated. Thanks!