diff --git a/core/src/global/ionic-global.ts b/core/src/global/ionic-global.ts index c791906782..5e464e301f 100644 --- a/core/src/global/ionic-global.ts +++ b/core/src/global/ionic-global.ts @@ -3,19 +3,20 @@ import { configFromURL } from '../utils/config'; import { isIOS } from '../utils/platform'; import { Config } from './config'; -const Ionic = (window as any).Ionic = (window as any).Ionic || {}; + +const Ionic = (window as any)['Ionic'] = (window as any)['Ionic'] || {}; declare const Context: any; // queue used to coordinate DOM reads and // write in order to avoid layout thrashing Object.defineProperty(Ionic, 'queue', { - get: () => Context.queue + get: () => Context['queue'] }); // create the Ionic.config from raw config object (if it exists) // and convert Ionic.config into a ConfigApi that has a get() fn -const config = Ionic.config = Context.config = new Config({ - ...Ionic.config, +const config = Ionic['config'] = Context['config'] = new Config({ + ...Ionic['config'], ...configFromURL() }); diff --git a/core/src/index.ts b/core/src/index.ts index a13bc822b1..7e6555bc6c 100644 --- a/core/src/index.ts +++ b/core/src/index.ts @@ -1,3 +1,5 @@ + +// lifecycle export const enum ViewLifecycle { WillEnter = 'ionViewWillEnter', DidEnter = 'ionViewDidEnter', @@ -6,10 +8,12 @@ export const enum ViewLifecycle { WillUnload = 'ionViewWillUnload', } -// Util functions +// util functions export * from './utils/helpers'; export * from './utils/haptic'; export * from './utils/framework-delegate'; export * from './utils/platform'; export * from './utils/config'; +// interface +export * from './interface'; diff --git a/core/src/interface.d.ts b/core/src/interface.d.ts index 1a7ed2dfc0..85b5da4741 100644 --- a/core/src/interface.d.ts +++ b/core/src/interface.d.ts @@ -21,9 +21,6 @@ export * from './components/toast/toast-interface'; export * from './utils/input-interface'; export * from './global/config'; -// export index -export * from './index'; - export type Color = 'default'| 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger' | 'light' | 'medium' | 'dark'; export type Mode = 'ios' | 'md'; export type ComponentRef = Function | HTMLElement | string; diff --git a/core/src/utils/config.ts b/core/src/utils/config.ts index 11208d0190..2b7e458ce5 100644 --- a/core/src/utils/config.ts +++ b/core/src/utils/config.ts @@ -1,18 +1,4 @@ -export function setupConfig(config: {[key: string]: any}) { - const win = window as any; - const Ionic = win.Ionic; - if (Ionic && Ionic.config && Ionic.config.constructor.name !== 'Object') { - console.error('ionic config was already initialized'); - return; - } - win.Ionic = win.Ionic || {}; - win.Ionic.config = { - ...win.Ionic.config, - ...config - }; - return win.Ionic.config; -} export function configFromURL() { const config: any = {};