Install
yarn add ngx-customapp-proto-http
Install and configure ngx-customapp-errors and ngx-customapp-jwt packages, cos them are used by this package.
Create the config ProtoHttpConfig.
Import ProtoHttpModule.forRoot(config) in your app.module.
Use RequestService to make requests.
@Injectable()export class MenuService { constructor( private request: RequestService<Request.AsObject, Response.AsObject>, ) {} getCategoryList(): Observable<CategoryListResponse.AsObject> { return this.request.request( baseUrl + '/category/list', {categories: {}} // instance of the Request.AsObject ).pipe(map(resp => resp.categories!)) }}
Add VersionInterceptor to the app.module providers, if you wish.
@NgModule({ // ... imports, declarations, bootstrap providers: [ { provide: HTTP_INTERCEPTORS, useClass: VersionInterceptor, multi: true, } ]})export class AppModule {}
Used to disable setting version header.
Generated using TypeDoc
Usage
Install
Install and configure ngx-customapp-errors and ngx-customapp-jwt packages, cos them are used by this package.
Create the config ProtoHttpConfig.
Import ProtoHttpModule.forRoot(config) in your app.module.
Use RequestService to make requests.
Add VersionInterceptor to the app.module providers, if you wish.