Adding ServerTransferStateModule for AU with custom http interceptor for cache transfer.

This commit is contained in:
softsimon
2020-11-27 18:41:57 +07:00
parent 5248fadcea
commit d0da875e69
4 changed files with 71 additions and 9 deletions

View File

@@ -1,13 +1,19 @@
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { ServerModule } from '@angular/platform-server';
import { ServerModule, ServerTransferStateModule } from '@angular/platform-server';
import { AppModule } from './app.module';
import { AppComponent } from './components/app/app.component';
import { HttpCacheInterceptor } from './services/http-cache.interceptor';
@NgModule({
imports: [
AppModule,
ServerModule,
ServerTransferStateModule,
],
providers: [
{ provide: HTTP_INTERCEPTORS, useClass: HttpCacheInterceptor, multi: true }
],
bootstrap: [AppComponent],
})