javascript - Parse JS SDK + Angular + Ionic - Uncaught TypeError: object.get is not a function -
in app.js file have below code data parse. if if query parse first time dont data view, if query twice info in view error("uncaught typeerror: object.get not function "). please me resolve error.. thanks!
query.find({ $scope.getrsvps = function(params) { var rsvpobject = parse.object.extend("rsvpobject"); var query = new parse.query(rsvpobject); if(params !== undefined) { if(params.title !== undefined) { query.equalto("title", params.title); } if(params.discription !== undefined) { query.equalto("description", params.description); } } query.find({ success: function(results) { $scope.data = results; alert("successfully retrieved " + results.length + " rsvps!"); (var = 0; < results.length; i++) { var object = results[i]; $scope.data.push({'title': object.get('title')}); console.log(object.id + ' - ' + object.get("title") + " " + object.get("description")); } $scope.$apply(); }, error: function(error) { alert("error: " + error.code + " " + error.message); } }); }
angular file below
<div ng-controller="rsvp"> <button ng-click="getrsvps()">find all</button> <span ng-repeat="object in data">{{object.title}}</span> </div>
Comments
Post a Comment