ApplicationImpl cleanup, part 1:
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / more-routing / more-routing-config-extracted.js
blob10112248f379620fe492cece24c19d7645c8d366
3 Polymer({
5 is: 'more-routing-config',
7 properties: {
9 /**
10 * The routing driver to use.
12 * * `hash`: `MoreRouting.HashDriver`
13 * * `path`: `MoreRouting.PathDriver`
14 * * `mock`: `MoreRouting.MockDriver`
17 driver: String,
19 /**
22 urlPrefix: String,
26 ready: function() {
27 var config = {};
28 if (this.urlPrefix) config.prefix = this.urlPrefix;
30 var driver;
31 // TODO(nevir): Support custom drivers, too.
32 if (this.driver === 'hash') {
33 driver = new MoreRouting.HashDriver(config);
34 } else if (this.driver === 'path') {
35 driver = new MoreRouting.PathDriver(config);
36 } else if (this.driver === 'mock') {
37 driver = new MoreRouting.MockDriver(config);
38 } else {
39 throw new Error('Unknown driver type "' + this.driver + '"');
42 MoreRouting.driver = driver;
45 });