javascript - Why is this fetched data not being shown in my HTML? -


i'm fetching objects form parse database , displaying them in template:

js:

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) {         // object not retrieved successfully.         // error parse.error error code , message.       }     })   }) 

html:

<pre>{{downloads | json}}</pre> 

console.log($scope.downloads) outputs objects: [object, object].

but not being displaying between <pre></pre>

why this? , how accomplish want?

you forgot execute $apply function. try changing $scope.$apply();


Comments