move window.__config to an Angular constant; refactor AngularViewArray -> ViewArray + ViewArrayFactory

This commit is contained in:
alecmerdler 2017-01-21 00:14:37 -08:00
parent 615e233671
commit eea2a18c3f
16 changed files with 316 additions and 231 deletions

View file

@ -3,6 +3,7 @@ import * as Raven from 'raven-js';
quayConfig.$inject = [
'$provide',
'CONFIG',
'cfpLoadingBarProvider',
'$tooltipProvider',
'$compileProvider',
@ -12,6 +13,7 @@ quayConfig.$inject = [
export function quayConfig(
$provide,
CONFIG,
cfpLoadingBarProvider,
$tooltipProvider,
$compileProvider,
@ -38,7 +40,7 @@ export function quayConfig(
return tooltipFactory.apply(this, arguments);
};
if (!(<any>window).__config['DEBUG']) {
if (!CONFIG['DEBUG']) {
$compileProvider.debugInfoEnabled(false);
}
@ -50,12 +52,12 @@ export function quayConfig(
RestangularProvider.setBaseUrl('/api/v1/');
// Configure analytics.
if ((<any>window).__config && (<any>window).__config.MIXPANEL_KEY) {
if (CONFIG && CONFIG.MIXPANEL_KEY) {
$analyticsProvider.virtualPageviews(true);
}
// Configure sentry.
if ((<any>window).__config && (<any>window).__config.SENTRY_PUBLIC_DSN) {
if (CONFIG && CONFIG.SENTRY_PUBLIC_DSN) {
$provide.decorator("$exceptionHandler", function($delegate) {
return function(ex, cause) {
$delegate(ex, cause);