Angular HTTP API

The purpose of this library is to provide a very light API for making parameterized URL requests to an API server.
Installation
npm install angular-http-api
bower install angular-http-api
Usage
var app = angular.module('testApp', ['httpApi']);
app.config(function (httpApiProvider) {
httpApiProvider.setHost('google.com');
httpApiProvider.preferScheme('https');
});
app.factory('UserService', function (httpApi) {
return {
lookupUser: function (email) {
httpApi.get('/user/:email', {email: email});
},
searchUser: function (name) {
httpApi.get('/user/search', {}, {firstName: name});
}
};
});
app.controller('testCtrl', function (UserService) {
$scope.user;
$scope.matching = [];
UserService.lookupUser('petermelias@gmail.com').then(function (user) {
$scope.user = user;
});
UserService.searchUser('Peter').then(function (matches) {
$scope.matching = matches;
});
});
License
MIT