@ngx-resource/handler-fetch
Version:
Resource handler for fetch
37 lines (29 loc) • 820 B
Markdown
# -resource/handler-fetch
It's implementation of `ResourceHandler` which uses `fetch`
## How to install and setup it
```bash
& npm i --save -resource/core @ngx-resource/handler-ngx-http -resource/handler-fetch
```
In you app module
```typescript
// AoT requires an exported function for factories
export function fetchHandlerFactory() {
return new ResourceHandlerFetch();
}
({
imports: [
BrowserModule,
BrowserAnimationsModule,
ResourceModule.forRoot({
handler: { provide: ResourceHandler, useFactory: (fetchHandlerFactory) }
})
],
declarations: [...],
bootstrap: [...],
entryComponents: [...],
providers: [...]
})
export class AppModule {
}
```
## [Docs about -resource/core](https://github.com/troyanskiy/ngx-resource/blob/master/README.md)