mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Switched to angular 5's built-in transfer state api
This commit is contained in:
@@ -13,7 +13,6 @@ import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { GLOBAL_CONFIG, GlobalConfig } from '../config';
|
||||
|
||||
import { TransferState } from '../modules/transfer-state/transfer-state';
|
||||
import { MetadataService } from './core/metadata/metadata.service';
|
||||
import { HostWindowResizeAction } from './shared/host-window.actions';
|
||||
import { HostWindowState } from './shared/host-window.reducer';
|
||||
@@ -32,7 +31,6 @@ export class AppComponent implements OnInit {
|
||||
@Inject(GLOBAL_CONFIG) public config: GlobalConfig,
|
||||
@Inject(NativeWindowService) private _window: NativeWindowRef,
|
||||
private translate: TranslateService,
|
||||
private cache: TransferState,
|
||||
private store: Store<HostWindowState>,
|
||||
private metadata: MetadataService
|
||||
) {
|
||||
@@ -48,16 +46,6 @@ export class AppComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
ngAfterViewChecked() {
|
||||
this.syncCache();
|
||||
}
|
||||
|
||||
syncCache() {
|
||||
this.store.take(1).subscribe((state: HostWindowState) => {
|
||||
this.cache.set('state', state);
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
const env: string = this.config.production ? 'Production' : 'Development';
|
||||
const color: string = this.config.production ? 'red' : 'green';
|
||||
|
Reference in New Issue
Block a user