PeerTube/client/src/app/environment.ts

78 lines
1.3 KiB
TypeScript
Raw Normal View History

/* tslint:disable */
2017-06-11 05:28:22 -05:00
/**
* Angular 2
*/
import {
enableDebugTools,
disableDebugTools
} from '@angular/platform-browser';
import {
ApplicationRef,
enableProdMode
} from '@angular/core';
/**
* Environment Providers
*/
2017-01-13 05:16:00 -06:00
let PROVIDERS: any[] = [
2017-06-11 05:28:22 -05:00
/**
* Common env directives
*/
2016-09-06 15:40:57 -05:00
];
2017-06-11 05:28:22 -05:00
/**
* Angular debug tools in the dev console
* https://github.com/angular/angular/blob/86405345b781a9dc2438c0fbe3e9409245647019/TOOLS_JS.md
*/
let _decorateModuleRef = <T>(value: T): T => { return value; };
2016-09-06 15:40:57 -05:00
if ('production' === ENV) {
enableProdMode();
2017-06-11 05:28:22 -05:00
/**
* Production
*/
2017-01-13 05:16:00 -06:00
_decorateModuleRef = (modRef: any) => {
disableDebugTools();
return modRef;
};
2016-09-06 15:40:57 -05:00
PROVIDERS = [
...PROVIDERS,
2017-06-11 05:28:22 -05:00
/**
* Custom providers in production.
*/
2016-09-06 15:40:57 -05:00
];
} else {
_decorateModuleRef = (modRef: any) => {
const appRef = modRef.injector.get(ApplicationRef);
const cmpRef = appRef.components[0];
2017-06-11 05:28:22 -05:00
let _ng = (<any> window).ng;
2016-09-06 15:40:57 -05:00
enableDebugTools(cmpRef);
2017-06-11 05:28:22 -05:00
(<any> window).ng.probe = _ng.probe;
(<any> window).ng.coreTokens = _ng.coreTokens;
2016-09-06 15:40:57 -05:00
return modRef;
};
2017-06-11 05:28:22 -05:00
/**
* Development
*/
2016-09-06 15:40:57 -05:00
PROVIDERS = [
...PROVIDERS,
2017-06-11 05:28:22 -05:00
/**
* Custom providers in development.
*/
2016-09-06 15:40:57 -05:00
];
}
export const decorateModuleRef = _decorateModuleRef;
export const ENV_PROVIDERS = [
...PROVIDERS
];