@ngx-resource/handler-ngx-http-legacy
v5.0.0
Published
Resource handler Angular old http
Downloads
8
Maintainers
Readme
@ngx-resource/ngx-http-legacy
It's implementation of ResourceHandler
which uses Angular Http
from @angular/http
How to install and setup it
& npm i --save @ngx-resource/core @ngx-resource/ngx-http-legacy
In you app module
// AoT requires an exported function for factories
export function myHandlerFactory(http: Http) {
return new MyResourceHandler(http);
}
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
// Default ResourceHandler uses class `ResourceHandlerHttp`
ResourceModule.forRoot()
// Or set you own handler
//ResourceModule.forRoot({
// handler: { provide: ResourceHandler, useFactory: (myHandlerFactory), deps: [Http] }
//})
],
declarations: [...],
bootstrap: [...],
entryComponents: [...],
providers: [...]
})
export class AppModule {
}