aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/environment.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/environment.ts')
-rw-r--r--client/src/app/environment.ts54
1 files changed, 37 insertions, 17 deletions
diff --git a/client/src/app/environment.ts b/client/src/app/environment.ts
index 929e09490..799102d82 100644
--- a/client/src/app/environment.ts
+++ b/client/src/app/environment.ts
@@ -1,21 +1,35 @@
1 1/**
2// Angular 2 2 * Angular 2
3// rc2 workaround 3 */
4import { enableDebugTools, disableDebugTools } from '@angular/platform-browser'; 4import {
5import { enableProdMode, ApplicationRef } from '@angular/core'; 5 enableDebugTools,
6// Environment Providers 6 disableDebugTools
7} from '@angular/platform-browser';
8import {
9 ApplicationRef,
10 enableProdMode
11} from '@angular/core';
12/**
13 * Environment Providers
14 */
7let PROVIDERS: any[] = [ 15let PROVIDERS: any[] = [
8 // common env directives 16 /**
17 * Common env directives
18 */
9]; 19];
10 20
11// Angular debug tools in the dev console 21/**
12// https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md 22 * Angular debug tools in the dev console
13let _decorateModuleRef = function identity<T>(value: T): T { return value; }; 23 * https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md
24 */
25let _decorateModuleRef = <T>(value: T): T => { return value; };
14 26
15if ('production' === ENV) { 27if ('production' === ENV) {
16 enableProdMode(); 28 enableProdMode();
17 29
18 // Production 30 /**
31 * Production
32 */
19 _decorateModuleRef = (modRef: any) => { 33 _decorateModuleRef = (modRef: any) => {
20 disableDebugTools(); 34 disableDebugTools();
21 35
@@ -24,7 +38,9 @@ if ('production' === ENV) {
24 38
25 PROVIDERS = [ 39 PROVIDERS = [
26 ...PROVIDERS, 40 ...PROVIDERS,
27 // custom providers in production 41 /**
42 * Custom providers in production.
43 */
28 ]; 44 ];
29 45
30} else { 46} else {
@@ -33,17 +49,21 @@ if ('production' === ENV) {
33 const appRef = modRef.injector.get(ApplicationRef); 49 const appRef = modRef.injector.get(ApplicationRef);
34 const cmpRef = appRef.components[0]; 50 const cmpRef = appRef.components[0];
35 51
36 let _ng = (<any>window).ng; 52 let _ng = (<any> window).ng;
37 enableDebugTools(cmpRef); 53 enableDebugTools(cmpRef);
38 (<any>window).ng.probe = _ng.probe; 54 (<any> window).ng.probe = _ng.probe;
39 (<any>window).ng.coreTokens = _ng.coreTokens; 55 (<any> window).ng.coreTokens = _ng.coreTokens;
40 return modRef; 56 return modRef;
41 }; 57 };
42 58
43 // Development 59 /**
60 * Development
61 */
44 PROVIDERS = [ 62 PROVIDERS = [
45 ...PROVIDERS, 63 ...PROVIDERS,
46 // custom providers in development 64 /**
65 * Custom providers in development.
66 */
47 ]; 67 ];
48 68
49} 69}