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

5.0.0 • Public • Published

@ngx-resource/ngx-http-legacy

It's implementation of ResourceHandler which uses Angular Http from @angular/http

How to install and setup it

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

In you app module

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

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

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

Docs about @ngx-resource/core

Package Sidebar

Install

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

Weekly Downloads

6

Version

5.0.0

License

MIT

Last publish

Collaborators

  • troyanskiy