I want to put Parse.com JSON object into angular $scope, but my code seems not working
I want to get 'title'
from the 'objects'
and put it as array in $scope.title
And this is some part of my js code:
main_app.controller('getList', function($scope) {
Parse.Cloud.run("MJSEvent_All",{}, {
success: function(results) {
var object = results['objects'];
for (i = 0; i < object.length; i++) {
$scope.title = [object[i].get('title')];
};
},
error: function(errorObj) {
console.log(errorObj);
}
}); });
and for the html view:
<div class="row" ng-app="getParse" ng-controller="getList">
<h3>Event List</h3>
<table >
<tr>
<th>Title</th>
<th>Speaker</th>
</tr>
<tr>
<td ng-repeat="x in title"> {{x}} </td>
</tr>
</table>
</div>