mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
added initial home page content
This commit is contained in:
@@ -3,7 +3,6 @@ import {
|
||||
ChangeDetectionStrategy,
|
||||
Inject,
|
||||
ViewEncapsulation,
|
||||
OnDestroy,
|
||||
OnInit, HostListener
|
||||
} from "@angular/core";
|
||||
import { TranslateService } from "ng2-translate";
|
||||
@@ -11,7 +10,7 @@ import { HostWindowState } from "./shared/host-window.reducer";
|
||||
import { Store } from "@ngrx/store";
|
||||
import { HostWindowResizeAction } from "./shared/host-window.actions";
|
||||
|
||||
import { GLOBAL_CONFIG, GlobalConfig } from '../config';
|
||||
import { EnvConfig, GLOBAL_CONFIG, GlobalConfig } from '../config';
|
||||
|
||||
@Component({
|
||||
changeDetection: ChangeDetectionStrategy.Default,
|
||||
@@ -20,15 +19,7 @@ import { GLOBAL_CONFIG, GlobalConfig } from '../config';
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.css']
|
||||
})
|
||||
export class AppComponent implements OnDestroy, OnInit {
|
||||
private translateSubscription: any;
|
||||
|
||||
example: string;
|
||||
|
||||
data: any = {
|
||||
greeting: 'Hello',
|
||||
recipient: 'World'
|
||||
};
|
||||
export class AppComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
@Inject(GLOBAL_CONFIG) public EnvConfig: GlobalConfig,
|
||||
@@ -42,15 +33,9 @@ export class AppComponent implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.translateSubscription = this.translate.get('example.with.data', { greeting: 'Hello', recipient: 'DSpace' }).subscribe((translation: string) => {
|
||||
this.example = translation;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
if (this.translateSubscription) {
|
||||
this.translateSubscription.unsubscribe();
|
||||
}
|
||||
const env: string = EnvConfig.production ? "Production" : "Development";
|
||||
const color: string = EnvConfig.production ? "red" : "green";
|
||||
console.info(`Environment: %c${env}`, `color: ${color}; font-weight: bold;`);
|
||||
}
|
||||
|
||||
@HostListener('window:resize', ['$event'])
|
||||
|
Reference in New Issue
Block a user