2 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 <link rel=
"import" href=
"../polymer/polymer.html">
11 <link rel=
"import" href=
"routing.html">
12 <!-- TODO(nevir): import on demand? -->
13 <link rel=
"import" href=
"driver/hash.html">
14 <link rel=
"import" href=
"driver/mock.html">
15 <link rel=
"import" href=
"driver/path.html">
21 is
: 'more-routing-config',
26 * The routing driver to use.
28 * * `hash`: `MoreRouting.HashDriver`
29 * * `path`: `MoreRouting.PathDriver`
30 * * `mock`: `MoreRouting.MockDriver`
44 if (this.urlPrefix
) config
.prefix
= this.urlPrefix
;
47 // TODO(nevir): Support custom drivers, too.
48 if (this.driver
=== 'hash') {
49 driver
= new MoreRouting
.HashDriver(config
);
50 } else if (this.driver
=== 'path') {
51 driver
= new MoreRouting
.PathDriver(config
);
52 } else if (this.driver
=== 'mock') {
53 driver
= new MoreRouting
.MockDriver(config
);
55 throw new Error('Unknown driver type "' + this.driver
+ '"');
58 MoreRouting
.driver
= driver
;