1.0.5 • Published 5 years ago

cz-angular-core v1.0.5

Weekly downloads
15
License
-
Repository
-
Last release
5 years ago

Cz-Angular-Core

This project was generated with Angular CLI version 8.1.0.

Components

<cz-empty-page src="" width="100%" height="100%">
<cz-error-page src="" width="100%" height="100%">

Services

AuthService LocalStorageService CookieService

Interceptors

Http Interceptors Logging Interceptors

Imports

import { EmptyPageComponent, ErrorPageComponent, SpinnerComponent } from 'cz-angular-module';
import { HttpInterceptor, LoggingInterceptor } from 'cz-angular-module';
import { AuthService, CookiesService, LocalStorageService } from 'cz-angular-module';

##Http Interceptor Http Interceptor accept custom header config object like this
config { 'Authorization': string, 'Content-Type' : string, 'Accept' : string }
by default it acccept Authorization token from Cookie Service getCookie('token') method. first you have set token in cookie by using setCookieData('token','token') method.
Content-Type is Applicatin/json and Accept type is application/json and you can override this config by passing your config object in Authservice setheaderConfig method.

##HttpRequestManager Use HttpRequestManager for any http request
get(url,httpOptions)
post(url, body, httpOptions)
put(url, body, httpOptions)
delete(url , httpOptions)

##HttpOptions Structure Import HttpHeader
httpOptions = { headers: new HttpHeaders({ 'Content-Type':'application/json', 'Accept': 'application/json' }) }