Reputation: 345
I'm trying to pass variables in my urls using App Location and App Routing in Polymer, but the subroute doesn't seem to be picking up the variables. Can anyone help me figure out what I'm doing wrong?
Code:
<app-location route="{{route}}"></app-location>
<app-route
route="{{route}}"
pattern="/desk/:project/:scene"
data="{{data}}"
tail="{{subroute}}">
</app-route>
The route.path
is showing up as /variable/variable
, but the project
and scene
are blank.
Any help would be appreciated.
Upvotes: 0
Views: 75
Reputation: 336
The code below use two elements to monitor the complete URL.
The first will bind to the project value and output a {{subroute}} for the second element.
<app-location route="{{route}}"></app-location>
<app-route
route="{{route}}"
pattern="/desk/:project"
data="{{data}}"
tail="{{subroute}}">
</app-route>
The second will bind to the scene value.
<app-route
route="{{subroute}}"
pattern=":scene"
data="{{data}}">
</app-route>
Upvotes: 1