X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fenvironment.ts;h=dd327a62e4639886955ba80c5505a415503a6cad;hb=c182778e26b8478fae9d7dd0bf0687baf7b72fd1;hp=8bba89c4ecb139ea78fb7e25973b8a68f1414655;hpb=a6375e69668ea42e19531c6bc68dcd37f3f7cbd7;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/environment.ts b/client/src/app/environment.ts index 8bba89c4e..dd327a62e 100644 --- a/client/src/app/environment.ts +++ b/client/src/app/environment.ts @@ -1,25 +1,48 @@ +/* tslint:disable */ -// Angular 2 -// rc2 workaround -import { enableDebugTools, disableDebugTools } from '@angular/platform-browser'; -import { enableProdMode, ApplicationRef } from '@angular/core'; -// Environment Providers -let PROVIDERS = [ - // common env directives +/** + * Angular 2 + */ +import { + enableDebugTools, + disableDebugTools +} from '@angular/platform-browser'; +import { + ApplicationRef, + enableProdMode +} from '@angular/core'; +/** + * Environment Providers + */ +let PROVIDERS: any[] = [ + /** + * Common env directives + */ ]; -// Angular debug tools in the dev console -// https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md -let _decorateModuleRef = function identity(value) { return value; }; +/** + * Angular debug tools in the dev console + * https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md + */ +let _decorateModuleRef = (value: T): T => { return value; }; if ('production' === ENV) { - // Production - disableDebugTools(); enableProdMode(); + /** + * Production + */ + _decorateModuleRef = (modRef: any) => { + disableDebugTools(); + + return modRef; + }; + PROVIDERS = [ ...PROVIDERS, - // custom providers in production + /** + * Custom providers in production. + */ ]; } else { @@ -28,17 +51,21 @@ if ('production' === ENV) { const appRef = modRef.injector.get(ApplicationRef); const cmpRef = appRef.components[0]; - let _ng = (window).ng; + let _ng = ( window).ng; enableDebugTools(cmpRef); - (window).ng.probe = _ng.probe; - (window).ng.coreTokens = _ng.coreTokens; + ( window).ng.probe = _ng.probe; + ( window).ng.coreTokens = _ng.coreTokens; return modRef; }; - // Development + /** + * Development + */ PROVIDERS = [ ...PROVIDERS, - // custom providers in development + /** + * Custom providers in development. + */ ]; }