service-utility
v0.0.11
Published
This library is designed to enhance code reusability, streamline development, and promote efficiency.
Downloads
4
Readme
Service Utility
This library is designed to enhance code reusability, streamline development, and promote efficiency.
Installation
npm i service-utility
To utilize HTTP calls effectively
import { APIService } from 'service-utility';
constructor(
private apiService: APIService
) {
this.apiService.get('').subscribe((res) => {
})
}
To utilize Common functions effectively
import { CommonService } from 'service-utility';
For Toaster
- Import to app.module.ts
import { ToasterModule } from 'service-utility';
ToasterModule.forRoot({ preventDuplicates: true, positionClass: 'toast-top-right', timeOut: 4000 }),
- add in angular.json
"node_modules/service-utility/lib/toaster/assets/toastr.css",
- use in component.ts
import { ToasterService } from 'service-utility';
private toaster: ToasterService
toaster.success('Data Successfully updated!')
Usage
import foobar
# returns 'words'
foobar.pluralize('word')
# returns 'geese'
foobar.pluralize('goose')
# returns 'phenomenon'
foobar.singularize('phenomena')