@ngx-resource/handler-ngx-http-legacy
Version:
Resource handler Angular old http
42 lines (33 loc) • 997 B
Markdown
# -resource/ngx-http-legacy
It's implementation of `ResourceHandler` which uses Angular `Http` from `/http`
## How to install and setup it
```bash
& npm i --save -resource/core @ngx-resource/ngx-http-legacy
```
In you app module
```typescript
// AoT requires an exported function for factories
export function myHandlerFactory(http: Http) {
return new MyResourceHandler(http);
}
({
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 {
}
```
## [Docs about -resource/core](https://github.com/troyanskiy/ngx-resource-core/blob/master/README.md)