Skip to content

Instantly share code, notes, and snippets.

@caionorder
Last active September 30, 2015 19:22
Show Gist options
  • Save caionorder/0d293d4277295835b6fc to your computer and use it in GitHub Desktop.
Save caionorder/0d293d4277295835b6fc to your computer and use it in GitHub Desktop.
.factory('Cupons', function($http, $q) {
var cupons = [];
return {
all: function(info) {
console.log(deferred);
cupons = $http({
url: 'http://ofertasdahora.me/json/cupons/cupons/list',
method: 'GET',
params:{
'cliente':info.id,
}
});
return cupons;
},
get: function(id) {
cupons = $http({
url: 'http://ofertasdahora.me/json/cupons/cupons/list',
method: 'POST',
params: {
'id':id,
}
});
return cupons;
}
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment