• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!--
2@license
3Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7Code distributed by Google as part of the polymer project is also
8subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9-->
10<link rel="import" href="../../../polymer/polymer.html">
11
12<dom-module id="route-info">
13  <template>
14    <style>
15      :host {
16        font-style: italic;
17        font-size: 0.85em;
18        font-weight: 200;
19        white-space: nowrap;
20        overflow: hidden;
21        text-overflow: ellipsis;
22        color: #fff;
23      }
24    </style>
25    <span>Route prefix: {{route.prefix}} &middot; Route path: {{route.path}} &middot; Query params: {{_stringifyQueryParams(route.queryParams.*)}}</span>
26  </template>
27  <script>
28    Polymer({
29      is: 'route-info',
30
31      properties: {
32        route: {
33          type: Object
34        }
35      },
36
37      _stringifyQueryParams: function() {
38        var params = [];
39        if (this.route && this.route.queryParams) {
40          for (var key in this.route.queryParams) {
41            params.push(key + ' = ' + this.route.queryParams[key]);
42          }
43        }
44        return params.join(', ');
45      }
46    })
47  </script>
48</dom-module>
49