I have been working on retrieving a list of names from parse and adding them to an onsenui list. The parse query seems to be functioning correctly as I logged the results successfully, but for some reason, the list items are not appearing anywhere.
Below is the content of app.js
(function(){
var app = angular.module('myApp', ['onsen.directives']);
app.factory('Data', function(){
var Data = {};
Data.items = [];
var parseAPPID = "***************************************";
var parseJSID = "****************************************";
//Initialize Parse
Parse.initialize(parseAPPID,parseJSID);
var NoteOb = Parse.Object.extend("place");
//$(document).on("pageshow", "#places", function(e, ui) {
//$.mobile.loading("show");
var Places = Parse.Object.extend("Places");
var query = new Parse.Query(Places);
query.limit(100);
query.ascending("Name");
query.find({
success:function(results) {
for(var i=0; i<results.length; i++) {
Data.items[i] = results[i].get('Name');
}
},error:function(e) {
}
});
return Data;
});
app.controller('listCtrl', function($scope, Data) {
$scope.items = Data.items;
});
})();
And here is the HTML code:
Index.html:
<!DOCTYPE html>
<html ng-app="myApp">
<head>
... (omitted for brevity)
</body>
</html>
List.html:
<!DOCTYPE HTML>
<html>
<head>
... (omitted for brevity)
</body>
</html>