0.0.5 • Published 6 years ago

angular-simple-data-service v0.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Purpose

Provide a standard data service class for simple front end apps Not meant for production on large apps

Usage

Usage: import GenericDataService and create your service class as an extended class.

Call super and add the required objects to your constructor

Example:

import { Injectable } from '@angular/core';
import { GenericDataService } from 'GenericDataService';
import { HttpClient } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})

export class HourService extends GenericDataService{
  constructor(public http: HttpClient) {
    super({
      baseURL: 'http://my.api',
      resourceURL: 'user'
    }, http);

    console.log(this.pluralResourceURL); // -> 'users'
  }
  
}

Now the Hour service will have the following methods