This is my first experience with using angular and parse.com.
I encountered the following error:
Error: Argument 'eventList' is not a function, got undefined
when attempting to execute the following angular code:
var main_app = angular.module('getParse', []);
main_app.controller('eventList', function() {
var mainTable = document.getElementById("mainTable");
mainTable.hidden = true;
Parse.Cloud.run("MJSEvent_All",{}, {
success: function(results) {
//console.log(eventObj);
var objects = results['objects'];
for (i = 0; i < objects.length; i++) {
var tr = document.createElement('TR');
var td = document.createElement('TD')
td.appendChild(document.createTextNode(objects[i].get('title')));
tr.appendChild(td)
var speakerObj = objects[i].get('session2')[0].get('speaker2')[0];
var td = document.createElement('TD')
td.appendChild(document.createTextNode(speakerObj.get('displayName')));
tr.appendChild(td)
mainTable.appendChild(tr);
}
},
error: function(errorObj) {
console.log(errorObj);
}
});});
Below is my html code snippet:
<div class="row" ng-app="getParse" ng-controller="eventList">
<h3>Event List</h3>
<table border=1 id="mainTable">
<tr>
<th>Title</th>
<th>Speaker</th>
</tr>
</table>
</div>
If you have any insights on how I can resolve this issue, please share them. Thank you!