UNPKG

1.11 kBJavaScriptView Raw
1/**
2 * @hidden
3 */
4var Config = (function () {
5 function Config() {
6 /**
7 * @private
8 */
9 this.urls = {
10 'api': 'https://api.ionic.io',
11 'web': 'https://web.ionic.io'
12 };
13 }
14 /**
15 * Register a new config.
16 */
17 Config.prototype.register = function (settings) {
18 this.settings = settings;
19 };
20 /**
21 * Get a value from the core settings. You should use `settings` attribute
22 * directly for core settings and other settings.
23 *
24 * @deprecated
25 *
26 * @param name - The settings key to get.
27 */
28 Config.prototype.get = function (name) {
29 if (!this.settings || !this.settings.core) {
30 return undefined;
31 }
32 return this.settings.core[name];
33 };
34 /**
35 * @hidden
36 */
37 Config.prototype.getURL = function (name) {
38 var urls = (this.settings && this.settings.core && this.settings.core.urls) || {};
39 if (urls[name]) {
40 return urls[name];
41 }
42 return this.urls[name];
43 };
44 return Config;
45}());
46export { Config };