Skip to content

Instantly share code, notes, and snippets.

@abhiaiyer91
Created July 24, 2014 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhiaiyer91/69e4a617fff98c34d7b8 to your computer and use it in GitHub Desktop.
Save abhiaiyer91/69e4a617fff98c34d7b8 to your computer and use it in GitHub Desktop.
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