aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/environment.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-09-06 22:40:57 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-09-06 22:40:57 +0200
commitab32b0fc805b92c5a1d7ac5901cb1a38e94622ca (patch)
tree1749a7390cf0a726a179c5fa554053f5c0f0e51c /client/src/app/environment.ts
parent088a967fe0bc285aa7811515f6a9655e1144b9f9 (diff)
downloadPeerTube-ab32b0fc805b92c5a1d7ac5901cb1a38e94622ca.tar.gz
PeerTube-ab32b0fc805b92c5a1d7ac5901cb1a38e94622ca.tar.zst
PeerTube-ab32b0fc805b92c5a1d7ac5901cb1a38e94622ca.zip
Dirty update to Angular RC6
Diffstat (limited to 'client/src/app/environment.ts')
-rw-r--r--client/src/app/environment.ts50
1 files changed, 50 insertions, 0 deletions
diff --git a/client/src/app/environment.ts b/client/src/app/environment.ts
new file mode 100644
index 000000000..8bba89c4e
--- /dev/null
+++ b/client/src/app/environment.ts
@@ -0,0 +1,50 @@
1
2// Angular 2
3// rc2 workaround
4import { enableDebugTools, disableDebugTools } from '@angular/platform-browser';
5import { enableProdMode, ApplicationRef } from '@angular/core';
6// Environment Providers
7let PROVIDERS = [
8 // common env directives
9];
10
11// Angular debug tools in the dev console
12// https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md
13let _decorateModuleRef = function identity(value) { return value; };
14
15if ('production' === ENV) {
16 // Production
17 disableDebugTools();
18 enableProdMode();
19
20 PROVIDERS = [
21 ...PROVIDERS,
22 // custom providers in production
23 ];
24
25} else {
26
27 _decorateModuleRef = (modRef: any) => {
28 const appRef = modRef.injector.get(ApplicationRef);
29 const cmpRef = appRef.components[0];
30
31 let _ng = (<any>window).ng;
32 enableDebugTools(cmpRef);
33 (<any>window).ng.probe = _ng.probe;
34 (<any>window).ng.coreTokens = _ng.coreTokens;
35 return modRef;
36 };
37
38 // Development
39 PROVIDERS = [
40 ...PROVIDERS,
41 // custom providers in development
42 ];
43
44}
45
46export const decorateModuleRef = _decorateModuleRef;
47
48export const ENV_PROVIDERS = [
49 ...PROVIDERS
50];