1
0

Add a mechanism to configure environment variables.

This commit is contained in:
Giuseppe Digilio
2017-01-20 15:08:30 +01:00
parent c31a0c927f
commit 5ada934e67
7 changed files with 134 additions and 34 deletions

View File

@@ -9,6 +9,7 @@ import { TranslateService } from "ng2-translate";
import { HostWindowState } from "./shared/host-window.reducer";
import { Store } from "@ngrx/store";
import { HostWindowActions } from "./shared/host-window.actions";
import { GlobalConfig } from "../config";
@Component({
changeDetection: ChangeDetectionStrategy.Default,
@@ -27,6 +28,13 @@ export class AppComponent implements OnDestroy, OnInit {
recipient: 'World'
};
title: string = GlobalConfig.title;
env: string = GlobalConfig.production;
styles = {
color: 'red'
};
constructor(
private translate: TranslateService,
private store: Store<HostWindowState>
@@ -51,6 +59,7 @@ export class AppComponent implements OnDestroy, OnInit {
@HostListener('window:resize', ['$event'])
private onResize(event): void {
console.log(GlobalConfig.rest.baseURL);
this.store.dispatch(
HostWindowActions.resize(event.target.innerWidth, event.target.innerHeight)
);