添加路由复用策略
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { RouteReuseStrategy } from '@angular/router';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common'
|
||||
import { HttpClientModule } from '@angular/common/http'
|
||||
@@ -25,6 +26,9 @@ import { LoginAuthService } from './services/login-auth.service';
|
||||
/* websocket */
|
||||
import { WebsocketService } from './services/websocket.service';
|
||||
|
||||
/* 路由缓存策略 */
|
||||
import { AppReuseStrategy } from './router-reuse-strategy';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
@@ -43,7 +47,8 @@ import { WebsocketService } from './services/websocket.service';
|
||||
LoginAuthService,
|
||||
HttpService,
|
||||
HttpClientService,
|
||||
WebsocketService
|
||||
WebsocketService,
|
||||
{ provide: RouteReuseStrategy, useClass: AppReuseStrategy }
|
||||
],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user