@xyzblocks/ng-http-interceptors
v0.0.1
Published
Angular HTTP Interceptors
Downloads
1
Readme
@xyzblocks/ng-http-interceptors
Angular HTTP Interceptors
Installation
npm install --save @xyzblocks/ng-http-interceptors
API
CachingHttpInterceptor
@NgModule({
declarations: [AppComponent],
imports: [],
providers: [
{
provide: HTTP_INTERCEPTORS,
useValue: new CachingHttpInterceptor(
{
delete: [/.*/],
get: [/.*/],
patch: [/.*/],
post: [/.*/],
put: [/.*/]
},
null, // getCacheItem(key: string) => Observable<any>; Uses localStorage by default
null, // setCacheItem(key: string, obj: any) => Observable<void>; Uses localStorage by default
),
multi: true,
},
],
bootstrap: [AppComponent],
})
export class AppModule {}