7.0.0-beta.1 • Published 4 years ago

@ngx-resource/handler-fetch v7.0.0-beta.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

@ngx-resource/handler-fetch

It's implementation of ResourceHandler which uses fetch

How to install and setup it

& npm i --save @ngx-resource/core @ngx-resource/handler-ngx-http @ngx-resource/handler-fetch

In you app module

// AoT requires an exported function for factories
export function fetchHandlerFactory() {
    return new ResourceHandlerFetch();
}

@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    
    ResourceModule.forRoot({
      handler: { provide: ResourceHandler, useFactory: (fetchHandlerFactory) }
    })
  ],
  declarations: [...],
  bootstrap: [...],
  entryComponents: [...],
  providers: [...]
})
export class AppModule {
}

Docs about @ngx-resource/core