Skip to content

Instantly share code, notes, and snippets.

@tobiaswright
tobiaswright / Factory for pulling AJAX (GET)
Last active December 18, 2015 15:49
AJAX calls in AngularJS, using GET and POST
//Factory for pulling data (most likely json) using deffered method
app.factory('items', function($http, $q){
return{
getItems: function(){
//Creating a deferred object
var deferred = $q.defer();
//Calling Web API to fetch items
$http({