@ngx-resource/handler-fetch
TypeScript icon, indicating that this package has built-in type declarations

7.0.0-beta.1 • Public • Published

@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

Package Sidebar

Install

npm i @ngx-resource/handler-fetch

Weekly Downloads

0

Version

7.0.0-beta.1

License

MIT

Unpacked Size

93.3 kB

Total Files

20

Last publish

Collaborators

  • troyanskiy