ngx-crud
TypeScript icon, indicating that this package has built-in type declarations

17.0.0 • Public • Published

NGX CRUD

CRUD services in Angular with effortless aborting, caching and observing.

Build Status Coverage Status NPM Version License

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 '@environments';

@Injectable()
@ApiUrl(environment.apiUrl)
@ApiRoute(environment.apiRoutes.example)
export class ExampleService extends CrudService<RequestBody, ResponseBody>
{
}

Use the HTTP operations as needed:

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 for a deep dive.

Package Sidebar

Install

npm i ngx-crud

Homepage

ngx-crud.com

Weekly Downloads

136

Version

17.0.0

License

MIT

Unpacked Size

248 kB

Total Files

79

Last publish

Collaborators

  • henryruhs