-
Notifications
You must be signed in to change notification settings - Fork 1
/
app-route.html
97 lines (78 loc) · 2.6 KB
/
app-route.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!--
@license
Copyright (c) 2017 The expand.js authors. All rights reserved.
This code may only be used under the BSD style license found at https://expandjs.github.io/LICENSE.txt
The complete set of authors may be found at https://expandjs.github.io/AUTHORS.txt
The complete set of contributors may be found at https://expandjs.github.io/CONTRIBUTORS.txt
-->
<!--
A web component used to configure a route.
@element app-route
@since 1.0.0
@category functionality
@description A web component used to configure a route
@keywords expandjs, web app, web components
@homepage https://expandjs.com/components/app-route
@repository https://github.com/expandjs/app-behaviors
@source https://github.com/expandjs/app-behaviors/blob/master/app-route.html
@behavior xp-master-slave-behavior /bower_components/xp-elements/xp-master-slave-behavior.html
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../expandjs/expandjs.html">
<link rel="import" href="../xp-elements/xp-master-slave-behavior.html">
<dom-module id="app-route">
<template strip-whitespace>
<style>
:host {
display: none !important;
}
</style>
</template>
<script>
Polymer({
// ELEMENT
is: 'app-route',
// BEHAVIORS
behaviors: [
Polymer.XPMasterSlaveBehavior
],
// CLASSES
classes: ['route'],
/*********************************************************************/
// PROPERTIES
properties: {
/**
* The path that has to be matched against the URL hash to activate the route.
*
* @attribute path
* @type string
*/
path: {
reflectToAttribute: true,
type: String
},
/**
* The path to be redirected at if the route becomes active.
*
* @attribute redirect
* @type string
*/
redirect: {
reflectToAttribute: true,
type: String
},
/**
* The application's router.
*
* @attribute router
* @type Element
* @readonly
*/
router: {
master: '.router',
readOnly: true
}
}
});
</script>
</dom-module>