Created
July 11, 2015 17:39
-
-
Save jforaker/e5040d19b9e69e44769b to your computer and use it in GitHub Desktop.
Sample Parse service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.factory('ParseService', function ($q) { | |
var parse = {}; | |
var query = new Parse.Query('Images'); | |
parse.findAll = function () { | |
var notModerated = query.equalTo('State', undefined); | |
return notModerated.find({ | |
success: function (results) { | |
console.log('results =', results); | |
return results; | |
}, | |
error: function (error) { | |
console.warn('error =', error); | |
return error.message; | |
} | |
}); | |
}; | |
return parse; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment