Ajout d'un système de cache des
requêtes HTTP
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { BrowserModule } from "@angular/platform-browser";
|
||||
import { NgModule } from "@angular/core";
|
||||
import { RouterModule, Routes } from "@angular/router";
|
||||
import { HttpClientModule, HTTP_INTERCEPTORS } from "@angular/common/http";
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { AppComponent } from "./app.component";
|
||||
|
||||
import { SummaryComponent } from './summary/summary.component';
|
||||
import { ListOfJumpsComponent } from './list-of-jumps/list-of-jumps.component';
|
||||
import { ListOfDzsComponent } from './list-of-dzs/list-of-dzs.component';
|
||||
import { NewJumpComponent } from './new-jump/new-jump.component';
|
||||
import { ListOfAircraftsComponent } from './list-of-aircrafts/list-of-aircrafts.component';
|
||||
import { ListOfJumpTypesComponent } from './list-of-jump-types/list-of-jump-types.component';
|
||||
import { SummaryComponent } from "./summary/summary.component";
|
||||
import { ListOfJumpsComponent } from "./list-of-jumps/list-of-jumps.component";
|
||||
import { ListOfDzsComponent } from "./list-of-dzs/list-of-dzs.component";
|
||||
import { NewJumpComponent } from "./new-jump/new-jump.component";
|
||||
import { ListOfAircraftsComponent } from "./list-of-aircrafts/list-of-aircrafts.component";
|
||||
import { ListOfJumpTypesComponent } from "./list-of-jump-types/list-of-jump-types.component";
|
||||
|
||||
import { DateService } from '../services/dateService';
|
||||
import { ServiceApiGet } from '../services/serviceApiGet';
|
||||
import { ServiceApiPost } from '../services/serviceApiPost';
|
||||
import { ServiceComm } from '../services/serviceComm';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { DateService } from "../services/date.service";
|
||||
import { ServiceApiGet } from "../services/service-api-get.service";
|
||||
import { ServiceApiPost } from "../services/service-api-post.service";
|
||||
import { ServiceComm } from "../services/service-comm.service";
|
||||
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
|
||||
import { FormsModule } from "@angular/forms";
|
||||
import {
|
||||
MatPaginatorModule,
|
||||
MatTableModule,
|
||||
@@ -30,20 +30,19 @@ import {
|
||||
MatInputModule,
|
||||
MatButtonModule,
|
||||
MatIconModule
|
||||
} from '@angular/material';
|
||||
|
||||
|
||||
} from "@angular/material";
|
||||
import { RequestCache } from "../services/request-cache.service";
|
||||
import { CachingInterceptor } from "../services/caching-interceptor.service";
|
||||
|
||||
const appRoutes: Routes = [
|
||||
{ path: 'summary', component: SummaryComponent },
|
||||
{ path: 'jumpsList', component: ListOfJumpsComponent },
|
||||
{ path: 'dz', component: ListOfDzsComponent },
|
||||
{ path: 'newjump', component: NewJumpComponent },
|
||||
{ path: 'aircraftList', component: ListOfAircraftsComponent },
|
||||
{ path: 'jumpTypeList', component: ListOfJumpTypesComponent }
|
||||
{ path: "summary", component: SummaryComponent },
|
||||
{ path: "jumpsList", component: ListOfJumpsComponent },
|
||||
{ path: "dz", component: ListOfDzsComponent },
|
||||
{ path: "newjump", component: NewJumpComponent },
|
||||
{ path: "aircraftList", component: ListOfAircraftsComponent },
|
||||
{ path: "jumpTypeList", component: ListOfJumpTypesComponent }
|
||||
];
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
@@ -75,7 +74,14 @@ const appRoutes: Routes = [
|
||||
MatIconModule
|
||||
],
|
||||
exports: [HttpClientModule],
|
||||
providers: [ServiceApiPost, ServiceApiGet, ServiceComm, DateService],
|
||||
providers: [
|
||||
ServiceApiPost,
|
||||
ServiceApiGet,
|
||||
ServiceComm,
|
||||
DateService,
|
||||
RequestCache,
|
||||
{ provide: HTTP_INTERCEPTORS, useClass: CachingInterceptor, multi: true }
|
||||
],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
export class AppModule { }
|
||||
export class AppModule {}
|
||||
|
||||
Reference in New Issue
Block a user