@kachit/ngx-api-query-builder
v1.3.9
Published
Angular API query filter builder
Downloads
6
Readme
Angular API query filter builder
Angular API query filter builder
npm i @kachit/ngx-api-query-builder
//your-service-class.ts
import { QueryBuilderService } from '@kachit/angular-api-query-builder';
import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators';
let qb = new QueryBuilderService();
let http = new HttpClient();
let params = qb.eq('active', true).build();
let url = 'http://api.your-domain.com/foo';
let data = http.get(url, {params: params}).pipe(
map((response) => { return response.data})
);
GET http://api.your-domain.com/foo?filter[$eq][active]=true