Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/henryruhs/ngx-crud
CRUD services in Angular with effortless aborting, caching and observing
https://github.com/henryruhs/ngx-crud
aborting angular caching crud http observing
Last synced: about 2 months ago
JSON representation
CRUD services in Angular with effortless aborting, caching and observing
- Host: GitHub
- URL: https://github.com/henryruhs/ngx-crud
- Owner: henryruhs
- License: other
- Created: 2018-08-12T19:21:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-19T21:37:20.000Z (3 months ago)
- Last Synced: 2024-10-13T13:07:57.477Z (2 months ago)
- Topics: aborting, angular, caching, crud, http, observing
- Language: TypeScript
- Homepage: https://ngx-crud.com
- Size: 336 KB
- Stars: 19
- Watchers: 0
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
- fucking-awesome-angular - ngx-crud - CRUD services in Angular with effortless aborting, caching and observing. (Table of contents / Third Party Components)
- awesome-angular - ngx-crud - CRUD services in Angular with effortless aborting, caching and observing. (Table of contents / Third Party Components)
README
NGX CRUD
========> CRUD services in Angular with effortless aborting, caching and observing.
[![Build Status](https://img.shields.io/github/actions/workflow/status/henryruhs/ngx-crud/ci.yml.svg?branch=master)](https://github.com/henryruhs/ngx-crud/actions?query=workflow:ci)
[![Coverage Status](https://img.shields.io/coveralls/henryruhs/ngx-crud.svg)](https://coveralls.io/r/henryruhs/ngx-crud)
[![NPM Version](https://img.shields.io/npm/v/ngx-crud.svg)](https://npmjs.com/package/ngx-crud)
[![License](https://img.shields.io/npm/l/ngx-crud.svg)](https://npmjs.com/package/ngx-crud)Installation
------------```
npm install ngx-crud
```Setup
-----Import the `CrudModule` and `HttpClientModule` inside your `AppModule`:
```typescript
import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { CrudModule } from 'ngx-crud';@NgModule(
{
imports:
[
CrudModule,
HttpClientModule
]
})
export class AppModule
{
}
```Usage
-----Extend the `ExampleService` from the `CrudService`:
```typescript
import { Injectable } from '@angular/core';
import { CrudService } from 'ngx-crud';
import { RequestBody, ResponseBody } from './example.interface';import { environment } from '@environments';
@Injectable()
@ApiUrl(environment.apiUrl)
@ApiRoute(environment.apiRoutes.example)
export class ExampleService extends CrudService
{
}
```Use the HTTP operations as needed:
```typescript
exampleService.create(body, options);
exampleService.read(id, options);
exampleService.find(options);
exampleService.update(id, body, options);
exampleService.patch(id, body, options);
exampleService.delete(id, options);
exampleService.custom(method, options);
```Documentation
-------------Read the [documentation](https://henryruhs.gitbook.io/ngx-crud) for a deep dive.