https://github.com/prest/angular-prest
pREST component for Angular
https://github.com/prest/angular-prest
angular angular-components angular-directives angular2 angular4 angular5 angularjs prest
Last synced: 12 months ago
JSON representation
pREST component for Angular
- Host: GitHub
- URL: https://github.com/prest/angular-prest
- Owner: prest
- License: mit
- Created: 2017-09-01T21:14:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-08T11:35:09.000Z (about 8 years ago)
- Last Synced: 2024-04-14T05:33:35.630Z (almost 2 years ago)
- Topics: angular, angular-components, angular-directives, angular2, angular4, angular5, angularjs, prest
- Language: TypeScript
- Size: 133 KB
- Stars: 14
- Watchers: 17
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Angular pREST
It is a wrapper service to use with pREST API.
NPM: https://www.npmjs.com/package/angular-prest
## What is pREST?
- A fully RESTful API from any existing PostgreSQL database written in Go http://postgres.rest.
## Install
```bash
npm install angular-prest --save
```
## Example use:
You need to provide config data to the angular-prest service. Just import AngularPrestModule and put it in "imports" passing your config data to forRoot().
Ex:
yours app.module.ts
```
import { AngularPrestModule } from 'angular-prest';
```
and put AngularPrestModule in imports:
ex:
```
{
...
imports: [
AngularPrestModule.forRoot({
localStorageData: 'the-localstorage-keyword',
tokenPath: 'path-to-token',
baseUrl: 'the-base-prest-service-url'
})
]
...
}
```
that is all you need, now you can import the AngularPrestService in yours components angular and use it. o/
ex:
component example!
```
import { Component } from '@angular/core';
import { AngularPrestService } from 'angular-prest';
@Component({
selector: 'app-example',
templateUrl: './example.component.html',
styleUrls: ['./example.component.css']
})
export class ExampleComponent {
constructor(
private prestService: AngularPrestService
) { }
...
}
```