@clearpeaks/cp-common
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

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

Package Sidebar

Install

npm i @clearpeaks/cp-common

Weekly Downloads

1

Version

1.3.1

License

none

Unpacked Size

421 kB

Total Files

59

Last publish

Collaborators

  • clearpeaks