README
NGX CRUD
CRUD services in Angular with effortless aborting, caching and observing.
Installation
npm install ngx-crud
Setup
Import the CrudModule
and HttpClientModule
inside your AppModule
:
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
:
import { Injectable } from '@angular/core';
import { CrudService } from 'ngx-crud';
import { RequestBody, ResponseBody } from './example.interface';
import { environment } from '@env';
@Injectable()
export class ExampleService extends CrudService<RequestBody, ResponseBody>
{
protected apiUrl : string = environment.apiUrl;
protected apiRoute : string = environment.apiRoutes.example;
}
Documentation
Read the documenation for a deep dive.