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

14.0.1 • Public • Published

@ngx-resource/handler-ngx-http

It's implementation of ResourceHandler which uses Angular HttpClient

If you are using Angular 5, please use @ngx-resource/handler-ngx-http 5.x

How to install and setup it

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

In you app module

// AoT requires an exported function for factories
export function myHandlerFactory(http: HttpClient) {
    return new MyResourceHandler(http);
}

@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    HttpClientModule,

    // Default ResourceHandler uses class `ResourceHandlerHttpClient`
    ResourceModule.forRoot()
    
    // Or set you own handler
    //ResourceModule.forRoot({
    //  handler: { provide: ResourceHandler, useFactory: (myHandlerFactory), deps: [HttpClient] }
    //})
  ],
  declarations: [...],
  bootstrap: [...],
  entryComponents: [...],
  providers: [...]
})
export class AppModule {
}

Docs about @ngx-resource/core

Package Sidebar

Install

npm i @kkoehn/ngx-resource-handler-ngx-http

Weekly Downloads

1

Version

14.0.1

License

MIT

Unpacked Size

47.8 kB

Total Files

14

Last publish

Collaborators

  • kkoehn