diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-12-11 17:36:46 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-12 10:58:16 +0100 |
commit | 63c4db6d71b98523753c51747e308682d9a2e8a0 (patch) | |
tree | d26c0d092ce016f2afe56bf71b08ca4698fe673f /client/src/app/environment.ts | |
parent | 908f6e5e38e85cc0debab0051b7fa34b13025f96 (diff) | |
download | PeerTube-63c4db6d71b98523753c51747e308682d9a2e8a0.tar.gz PeerTube-63c4db6d71b98523753c51747e308682d9a2e8a0.tar.zst PeerTube-63c4db6d71b98523753c51747e308682d9a2e8a0.zip |
Move to angular cli
Diffstat (limited to 'client/src/app/environment.ts')
-rw-r--r-- | client/src/app/environment.ts | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/client/src/app/environment.ts b/client/src/app/environment.ts deleted file mode 100644 index dd327a62e..000000000 --- a/client/src/app/environment.ts +++ /dev/null | |||
@@ -1,77 +0,0 @@ | |||
1 | /* tslint:disable */ | ||
2 | |||
3 | /** | ||
4 | * Angular 2 | ||
5 | */ | ||
6 | import { | ||
7 | enableDebugTools, | ||
8 | disableDebugTools | ||
9 | } from '@angular/platform-browser'; | ||
10 | import { | ||
11 | ApplicationRef, | ||
12 | enableProdMode | ||
13 | } from '@angular/core'; | ||
14 | /** | ||
15 | * Environment Providers | ||
16 | */ | ||
17 | let PROVIDERS: any[] = [ | ||
18 | /** | ||
19 | * Common env directives | ||
20 | */ | ||
21 | ]; | ||
22 | |||
23 | /** | ||
24 | * Angular debug tools in the dev console | ||
25 | * https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md | ||
26 | */ | ||
27 | let _decorateModuleRef = <T>(value: T): T => { return value; }; | ||
28 | |||
29 | if ('production' === ENV) { | ||
30 | enableProdMode(); | ||
31 | |||
32 | /** | ||
33 | * Production | ||
34 | */ | ||
35 | _decorateModuleRef = (modRef: any) => { | ||
36 | disableDebugTools(); | ||
37 | |||
38 | return modRef; | ||
39 | }; | ||
40 | |||
41 | PROVIDERS = [ | ||
42 | ...PROVIDERS, | ||
43 | /** | ||
44 | * Custom providers in production. | ||
45 | */ | ||
46 | ]; | ||
47 | |||
48 | } else { | ||
49 | |||
50 | _decorateModuleRef = (modRef: any) => { | ||
51 | const appRef = modRef.injector.get(ApplicationRef); | ||
52 | const cmpRef = appRef.components[0]; | ||
53 | |||
54 | let _ng = (<any> window).ng; | ||
55 | enableDebugTools(cmpRef); | ||
56 | (<any> window).ng.probe = _ng.probe; | ||
57 | (<any> window).ng.coreTokens = _ng.coreTokens; | ||
58 | return modRef; | ||
59 | }; | ||
60 | |||
61 | /** | ||
62 | * Development | ||
63 | */ | ||
64 | PROVIDERS = [ | ||
65 | ...PROVIDERS, | ||
66 | /** | ||
67 | * Custom providers in development. | ||
68 | */ | ||
69 | ]; | ||
70 | |||
71 | } | ||
72 | |||
73 | export const decorateModuleRef = _decorateModuleRef; | ||
74 | |||
75 | export const ENV_PROVIDERS = [ | ||
76 | ...PROVIDERS | ||
77 | ]; | ||