Created
July 24, 2014 17:13
-
-
Save abhiaiyer91/69e4a617fff98c34d7b8 to your computer and use it in GitHub Desktop.
This file contains 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
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