1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 | var Config = (function () {
|
6 | function Config() {
|
7 | |
8 |
|
9 |
|
10 | this.urls = {
|
11 | 'api': 'https://api.ionic.io',
|
12 | 'web': 'https://web.ionic.io'
|
13 | };
|
14 | }
|
15 | |
16 |
|
17 |
|
18 | Config.prototype.register = function (settings) {
|
19 | this.settings = settings;
|
20 | };
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | Config.prototype.get = function (name) {
|
30 | if (!this.settings || !this.settings.core) {
|
31 | return undefined;
|
32 | }
|
33 | return this.settings.core[name];
|
34 | };
|
35 | |
36 |
|
37 |
|
38 | Config.prototype.getURL = function (name) {
|
39 | var urls = (this.settings && this.settings.core && this.settings.core.urls) || {};
|
40 | if (urls[name]) {
|
41 | return urls[name];
|
42 | }
|
43 | return this.urls[name];
|
44 | };
|
45 | return Config;
|
46 | }());
|
47 | exports.Config = Config;
|