Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
window.app.factory('Parse', ['parseConstant', function(parseConstant) {
function getJob(){
var jobsObj = Parse.Object.extend("Jobs");
var query = new Parse.Query(jobsObj);
return query.find();
}
return {
getJob: getJob
};
}]);
window.app.controller('Ctrl', ['$scope', 'Parse', function ($scope, Parse){
function successHandler(response){
$scope.$apply(function(){
$scope.cities = jobsCities(response);
$scope.trabajo = response;
});
}
function errorHandler(error){
console.log(error);
}
Parse.getJob().then(successHandler, errorHandler);
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment