]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/environment.ts
Implement header design
[github/Chocobozzz/PeerTube.git] / client / src / app / environment.ts
CommitLineData
df98563e
C
1/* tslint:disable */
2
8635a2c7
C
3/**
4 * Angular 2
5 */
6import {
7 enableDebugTools,
8 disableDebugTools
9} from '@angular/platform-browser';
10import {
11 ApplicationRef,
12 enableProdMode
13} from '@angular/core';
14/**
15 * Environment Providers
16 */
c16ce1de 17let PROVIDERS: any[] = [
8635a2c7
C
18 /**
19 * Common env directives
20 */
ab32b0fc
C
21];
22
8635a2c7
C
23/**
24 * Angular debug tools in the dev console
25 * https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md
26 */
27let _decorateModuleRef = <T>(value: T): T => { return value; };
ab32b0fc
C
28
29if ('production' === ENV) {
ab32b0fc
C
30 enableProdMode();
31
8635a2c7
C
32 /**
33 * Production
34 */
c16ce1de
C
35 _decorateModuleRef = (modRef: any) => {
36 disableDebugTools();
37
38 return modRef;
39 };
40
ab32b0fc
C
41 PROVIDERS = [
42 ...PROVIDERS,
8635a2c7
C
43 /**
44 * Custom providers in production.
45 */
ab32b0fc
C
46 ];
47
48} else {
49
50 _decorateModuleRef = (modRef: any) => {
51 const appRef = modRef.injector.get(ApplicationRef);
52 const cmpRef = appRef.components[0];
53
8635a2c7 54 let _ng = (<any> window).ng;
ab32b0fc 55 enableDebugTools(cmpRef);
8635a2c7
C
56 (<any> window).ng.probe = _ng.probe;
57 (<any> window).ng.coreTokens = _ng.coreTokens;
ab32b0fc
C
58 return modRef;
59 };
60
8635a2c7
C
61 /**
62 * Development
63 */
ab32b0fc
C
64 PROVIDERS = [
65 ...PROVIDERS,
8635a2c7
C
66 /**
67 * Custom providers in development.
68 */
ab32b0fc
C
69 ];
70
71}
72
73export const decorateModuleRef = _decorateModuleRef;
74
75export const ENV_PROVIDERS = [
76 ...PROVIDERS
77];