diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-11 12:28:22 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-11 12:28:22 +0200 |
commit | 8635a2c70cc24a4c52558162ac058de95750271f (patch) | |
tree | a9699b7c6696218604e6b273b4f34a6898d4f16b /client/src/app/environment.ts | |
parent | 66dd264f7b15c05006faa00694c88c56794edc54 (diff) | |
download | PeerTube-8635a2c70cc24a4c52558162ac058de95750271f.tar.gz PeerTube-8635a2c70cc24a4c52558162ac058de95750271f.tar.zst PeerTube-8635a2c70cc24a4c52558162ac058de95750271f.zip |
Update client modules
Diffstat (limited to 'client/src/app/environment.ts')
-rw-r--r-- | client/src/app/environment.ts | 54 |
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 | */ |
4 | import { enableDebugTools, disableDebugTools } from '@angular/platform-browser'; | 4 | import { |
5 | import { enableProdMode, ApplicationRef } from '@angular/core'; | 5 | enableDebugTools, |
6 | // Environment Providers | 6 | disableDebugTools |
7 | } from '@angular/platform-browser'; | ||
8 | import { | ||
9 | ApplicationRef, | ||
10 | enableProdMode | ||
11 | } from '@angular/core'; | ||
12 | /** | ||
13 | * Environment Providers | ||
14 | */ | ||
7 | let PROVIDERS: any[] = [ | 15 | let 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 |
13 | let _decorateModuleRef = function identity<T>(value: T): T { return value; }; | 23 | * https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md |
24 | */ | ||
25 | let _decorateModuleRef = <T>(value: T): T => { return value; }; | ||
14 | 26 | ||
15 | if ('production' === ENV) { | 27 | if ('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 | } |