JSPM

@ngx-resource/handler-fetch

10.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q54328F
  • License MIT

Resource handler for fetch

Package Exports

  • @ngx-resource/handler-fetch

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ngx-resource/handler-fetch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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