Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/1backend/ng-client
Generic Angular client for all 1Backend services.
https://github.com/1backend/ng-client
Last synced: 5 days ago
JSON representation
Generic Angular client for all 1Backend services.
- Host: GitHub
- URL: https://github.com/1backend/ng-client
- Owner: 1backend
- Created: 2017-11-28T13:48:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-30T13:10:16.000Z (almost 7 years ago)
- Last Synced: 2024-11-01T05:46:40.399Z (12 days ago)
- Language: TypeScript
- Size: 61.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
1Backend Angular Client
===This package can be used to call any service on 1Backend.
Please also check the typesafe autogenerated APIs for your 1Backend services, you might find them more pleasant to use.
Installation:
```
npm install --save @1backend/ng-client
```Usage
```typescript
import { Component, OnInit } from '@angular/core';
import { NgClient } from '@1backend/ng-client';// This is a working test token.
// You can get your own tokens from 1Backend from your profile page (eg. https://1backend.com/your-name)
const token = '1c61722e-9e0b-461b-9e27-193464b081f9';@Component({
selector: 'app-example',
template: `Response: {{response}} Error: {{error}}`,
providers: [NgClient]
})
export class ExampleComponent implements OnInit {
response: string;
error: any;constructor(private ngClient: NgClient) {
this.ngClient.token = token;
this.ngClient.call('crufter', 'test', 'get', '/sql-example', {}).then(rsp => {
this.response = rsp;
})
.catch(err => {
this.error = err;
});
}ngOnInit() {}
}
```