Upgrading to Angular 12 and NgBootstrap 10
This commit is contained in:
@@ -17,7 +17,7 @@ export class HttpCacheInterceptor implements HttpInterceptor {
|
||||
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||
if (this.isBrowser && request.method === 'GET') {
|
||||
|
||||
const cachedResponse = this.transferState.get(makeStateKey(request.url), null);
|
||||
const cachedResponse = this.transferState.get<any>(makeStateKey(request.url), null);
|
||||
if (cachedResponse) {
|
||||
const modifiedResponse = new HttpResponse<any>({
|
||||
headers: cachedResponse.headers,
|
||||
@@ -35,7 +35,7 @@ export class HttpCacheInterceptor implements HttpInterceptor {
|
||||
.pipe(tap((event: HttpEvent<any>) => {
|
||||
if (!this.isBrowser && event instanceof HttpResponse) {
|
||||
let keyId = request.url.split('/').slice(3).join('/');
|
||||
this.transferState.set(makeStateKey('/' + keyId), event);
|
||||
this.transferState.set<any>(makeStateKey('/' + keyId), event);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user