This package has been deprecated

Author message:

The library has been moved to @ngx-resource/handler-ngx-http and all Rest renamed to Resource

rest-ngx
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

rest-ngx

It's implementation of RestHandler which uses Angular HttpClient

How to install and setup it

& npm i --save rest-core rest-ngx

In you app module

 
// AoT requires an exported function for factories
export function myHandlerFactory(http: HttpClient) {
    return new MyRestHandler(http);
}
 
@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    HttpClientModule,
 
    // Default RestHandler uses class `RestHandlerHttpClient`
    RestModule.forRoot()
    
    // Or set you own handler
    //RestModule.forRoot({
    //  handler: { provide: RestHandler, useFactory: (myHandlerFactory), deps: [HttpClient] }
    //})
  ],
  declarations: [...],
  bootstrap: [...],
  entryComponents: [...],
  providers: [...]
})
export class AppModule {
}

Docs about rest-core

Package Sidebar

Install

npm i rest-ngx

Weekly Downloads

15

Version

0.1.1

License

MIT

Last publish

Collaborators

  • troyanskiy