move window.__config to an Angular constant; refactor AngularViewArray -> ViewArray + ViewArrayFactory
This commit is contained in:
parent
615e233671
commit
eea2a18c3f
16 changed files with 316 additions and 231 deletions
|
@ -2,10 +2,11 @@ import * as angular from 'angular';
|
|||
import { quayConfig } from './quay.config';
|
||||
import quayPages from './quay-pages.module';
|
||||
import quayRun from './quay.run';
|
||||
import { angularViewArrayFactory } from './services/angular-view-array/angular-view-array';
|
||||
import { ViewArrayFactory } from './services/view-array/view-array.factory';
|
||||
import { routeBuilderFactory } from './route-builder/route-builder.service.impl';
|
||||
import NAME_PATTERNS from './constants/name-patterns.constant';
|
||||
import { routeConfig } from './quay.routes';
|
||||
import { CONFIG } from './constants/quay-config.constant';
|
||||
|
||||
|
||||
var quayDependencies: string[] = [
|
||||
|
@ -28,19 +29,19 @@ var quayDependencies: string[] = [
|
|||
'react'
|
||||
];
|
||||
|
||||
if ((<any>window).__config && ((<any>window).__config.MIXPANEL_KEY || (<any>window).__config.MUNCHKIN_KEY || (<any>window).__config.GOOGLE_ANALYTICS_KEY)) {
|
||||
if (CONFIG && (CONFIG.MIXPANEL_KEY || CONFIG.MUNCHKIN_KEY || CONFIG.GOOGLE_ANALYTICS_KEY)) {
|
||||
quayDependencies.push('angulartics');
|
||||
}
|
||||
if ((<any>window).__config && (<any>window).__config.MIXPANEL_KEY) {
|
||||
if (CONFIG && CONFIG.MIXPANEL_KEY) {
|
||||
quayDependencies.push('angulartics.mixpanel');
|
||||
}
|
||||
if ((<any>window).__config && (<any>window).__config.MUNCHKIN_KEY) {
|
||||
if (CONFIG && CONFIG.MUNCHKIN_KEY) {
|
||||
quayDependencies.push('angulartics.marketo');
|
||||
}
|
||||
if ((<any>window).__config && (<any>window).__config.GOOGLE_ANALYTICS_KEY) {
|
||||
if (CONFIG && CONFIG.GOOGLE_ANALYTICS_KEY) {
|
||||
quayDependencies.push('angulartics.google.analytics');
|
||||
}
|
||||
if ((<any>window).__config && (<any>window).__config.RECAPTCHA_SITE_KEY) {
|
||||
if (CONFIG && CONFIG.RECAPTCHA_SITE_KEY) {
|
||||
quayDependencies.push('vcRecaptcha');
|
||||
}
|
||||
|
||||
|
@ -49,7 +50,8 @@ export default angular
|
|||
.config(quayConfig)
|
||||
.config(routeConfig)
|
||||
.constant('NAME_PATTERNS', NAME_PATTERNS)
|
||||
.constant('CONFIG', CONFIG)
|
||||
.factory('RouteBuilder', routeBuilderFactory)
|
||||
.factory('AngularViewArray', angularViewArrayFactory)
|
||||
.service('ViewArrayFactory', ViewArrayFactory)
|
||||
.run(quayRun)
|
||||
.name;
|
Reference in a new issue