Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kachit/ngx-api-query-builder
Angular API query filter builder
https://github.com/kachit/ngx-api-query-builder
angular api-rest http-client query-builder
Last synced: 8 days ago
JSON representation
Angular API query filter builder
- Host: GitHub
- URL: https://github.com/kachit/ngx-api-query-builder
- Owner: Kachit
- License: mit
- Created: 2018-06-29T08:57:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T01:38:59.000Z (over 1 year ago)
- Last Synced: 2024-10-03T18:18:19.694Z (about 1 month ago)
- Topics: angular, api-rest, http-client, query-builder
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@kachit/ngx-api-query-builder
- Size: 5.38 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Angular API query filter builder
[![Npm badge](https://img.shields.io/npm/v/@kachit/ngx-api-query-builder.svg)][npm]
[![NPM downloads][npm-download]][npm]
[![npm License](https://img.shields.io/npm/l/ng-packagr.svg?style=flat-square)](https://github.com/kachit/ngx-api-query-builder/blob/master/LICENSE)
![angular](https://img.shields.io/badge/angular-^13.0-lightgrey.svg?style=flat-square)[npm]: https://www.npmjs.com/package/@kachit/ngx-api-query-builder
[npm-download]: https://img.shields.io/npm/dm/@kachit/ngx-api-query-builder.svg?style=flat-squareAngular API query filter builder
```bash
npm i @kachit/ngx-api-query-builder
``````js
//your-service-class.ts
import { QueryBuilderService } from '@kachit/ngx-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})
);
``````http request
GET http://api.your-domain.com/foo?filter[$eq][active]=true
```