CP Common - Angular 6+ library
A shared library of Angular Components, Services, Pipes, Directives and more.
Installation
npm i @clearpeaks/cp-common --save
Basic usage
Import the CpCommonModule
into your App Module:
import { CpCommonModule } from '@clearpeaks/cp-common';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
CpCommonModule.forRoot({
// ... Your config here
})
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Module configuration
Some items in this module require / accept custom configuration.
This config object can be provided as the CpCommonModule.forRoot()
method argument.
Config options
Property | Description | Type |
---|---|---|
urlEndpoint |
Provides a base URL for all your endpoints when used with ApiService | String |
logEnabled |
If true, error logging is enabled in the ErrorHandlerService | Boolean |
logEndpoint |
Endpoint for posting error messages from ErrorHandlerService | String |
logHttpRequest |
If true, LoggerInterceptor will log HTTP requests to the console | Boolean |
logHttpResponse |
If true, LoggerInterceptor will log HTTP responses to the console | Boolean |
httpLogEnabled |
Toggle HTTP logging off and on | Boolean |
Contents
Components
- SpinnerComponent
- PaginationComponent
Services
- ApiService
- ErrorHandlerService
Pipes
- SlugifyPipe
- CurrencyCommaPipe
- ThousandSuffixesPipe
Interceptors
- JwtInterceptor
- LoggerInterceptor
Licence
MIT