I have a situation where I am retrieving data from a Parse database and showing it on my template:
JavaScript Code:
angular.module('yoApp')
.controller('downloadsCtrl', function($q, $scope, $rootScope, $http, appService, serviceUpload, fileUpload) {
$scope.downloads = []
var Download = Parse.Object.extend('Download')
var query = new Parse.Query(Download)
query.find({
success: function(results) {
_.each(results, function(result) {
$scope.downloads.push(result.toJSON())
console.log($scope.downloads)
$scope.$apply
})
},
error: function(error) {
// There was an issue retrieving the object.
// error is a Parse.Error with an error code and message.
}
})
})
HTML Template:
<pre>{{downloads | json}}</pre>
console.log($scope.downloads)
shows the objects as: [Object, Object]
.
However, they are not being displayed within the <pre></pre>
tags.
What could be causing this issue? And how can I achieve the desired display?