$http adapter for easier connection to REST APIs
This module wraps angular's native $http
, adding convenience methods for REST API requests
Install through bower:
npm install angular-rest-adapter --save
- Require the
ngRestAdapter
module in your angular application
import "angular-rest-adapter";
angular.module('app', ['ngRestAdapter']);
- (Optionally) configure the service provider
import {NgRestAdapterServiceProvider} from "angular-rest-adapter";
angular.module('app', ['ngRestAdapter'])
.config(['ngRestAdapterProvider', function(ngRestAdapterProvider:NgRestAdapterServiceProvider){
ngRestAdapterProvider
.configure({
baseUrl: 'http://api.example.com/path/to/api/root'
})
;
}]);
- ???
- Profit!