Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dsabre/airtable
Simple Airtable service for Angular applications
https://github.com/dsabre/airtable
airtable angular
Last synced: about 1 month ago
JSON representation
Simple Airtable service for Angular applications
- Host: GitHub
- URL: https://github.com/dsabre/airtable
- Owner: dsabre
- License: mit
- Created: 2020-02-26T16:17:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-10T23:50:21.000Z (10 months ago)
- Last Synced: 2024-09-27T18:22:08.748Z (about 2 months ago)
- Topics: airtable, angular
- Language: TypeScript
- Homepage:
- Size: 2.44 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Welcome to @raniel/airtable 👋
[![Version](https://img.shields.io/npm/v/@raniel/airtable.svg)](https://www.npmjs.com/package/@raniel/airtable)
[![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](https://github.com/raniel86/airtable#readme)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/raniel86/airtable/graphs/commit-activity)
[![License: MIT](https://img.shields.io/github/license/raniel86/airtable)](https://github.com/raniel86/airtable/blob/master/LICENSE)
![Publish on npm](https://github.com/raniel86/airtable/workflows/Publish%20on%20npm/badge.svg)> Simple Airtable service for Angular applications.
## Install in your Angular app
```sh
npm i @raniel/airtable
```## Setup
Add the HttpClientModule to imports array in your app.module.ts, using the following import:
```ts
import {HttpClientModule} from '@angular/common/http';
```
Injects the AirtableService in a constructor like this:
```ts
constructor(private airtable: AirtableService) {}
```
Set your api key and database id to airtable service variables:
```ts
this.airtable.apiKey = 'YOUR_AIRTABLE_API_KEY';
this.airtable.dbId = 'YOUR_AIRTABLE_DATABASE_ID';
```## Usage
```ts
// get all rows from your table
this.airtable.getList('your_table_name').subscribe(response => {
console.log(response);
});// get a table row from a field value
this.airtable.getListByFieldValue('your_table_name', 'field_name', 'field_value').subscribe(response => {
console.log(response);
});// get a table row from its id
this.airtable.getRecord('your_table_name', 'ROW_ID').subscribe(response => {
console.log(response);
});// delete rows given their id
this.airtable.doDelete('your_table_name', ['ROW_ID_1', 'ROW_ID_2', 'ROW_ID_3', ..., 'ROW_ID_N']).subscribe(response => {
console.log(response);
});// insert a row in your table
this.airtable.doInsert('your_table_name', {
field1: 'field1 value',
field2: 'field2 value',
...
fieldN: 'fieldN value'
}).subscribe(response => {
console.log(response);
});// alter the values of a row given its id
this.airtable.doUpdate('your_table_name', 'ROW_ID', {
fieldName: 'new field value',
}).subscribe(response => {
console.log(response);
});// clear the table (be careful!)
this.airtable.doTruncate('your_table_name');
```## Author
👤 **Daniele Sabre (https://github.com/raniel86)**
* Github: [@raniel86](https://github.com/raniel86)
* Twitter: [@raniel86](https://twitter.com/raniel86)
* LinkedIn: [@danielesabre](https://linkedin.com/in/danielesabre)## 🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/raniel86/airtable/issues).
## Show your support
Give a ⭐️ if this project helped you!
## 📝 License
Copyright © 2020 [Daniele Sabre (https://github.com/raniel86)](https://github.com/raniel86).
This project is [MIT](https://github.com/raniel86/airtable/blob/master/LICENSE) licensed.
***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_