fix(global): add mode and config to Ionic global

This commit is contained in:
Adam Bradley
2017-12-13 16:28:51 -06:00
parent 4838d5ebfe
commit a795878a9e

View File

@ -14,7 +14,7 @@ if (!Context.dom) {
// create the Ionic.config from raw config object (if it exists)
// and convert Ionic.config into a ConfigApi that has a get() fn
Context.config = createConfigController(
Ionic.config = Context.config = createConfigController(
Ionic.config,
detectPlatforms(window.location.href, window.navigator.userAgent, PLATFORM_CONFIGS, 'core')
);
@ -23,7 +23,7 @@ Context.config = createConfigController(
// first see if the mode was set as an attribute on <html>
// which could have been set by the user, or by prerendering
// otherwise get the mode via config settings, and fallback to md
Context.mode = document.documentElement.getAttribute('mode') || Context.config.get('mode', 'md');
Ionic.mode = Context.mode = document.documentElement.getAttribute('mode') || Context.config.get('mode', 'md');
// ensure we've got the mode attribute set on <html>
document.documentElement.setAttribute('mode', Context.mode);
document.documentElement.setAttribute('mode', Ionic.mode);