This project was generated with Angular CLI version 8.1.0.
<cz-empty-page [src]="" [width]="100%" [height]="100%">
<cz-error-page [src]="" [width]="100%" [height]="100%">
AuthService LocalStorageService CookieService
Http Interceptors Logging Interceptors
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' })
}