Open benjaminapetersen opened 9 years ago
It's actually a really good idea. I've thought about that before too. I was thinking about completely splitting it into it's own element.
URL
/this/is/a/really/long/url?and=just&keep=going
Then put something like this in the page.
<url-parser path="/foo/:foo/bar/:bar/baz/:shizzle" model="{{url}}"></url-parser>
The Polymer element's this.url
would look like this.
{
"foo": "is",
"bar": "really",
"shizzle": "url",
"and": "just",
"keep": "going"
}
This way you could even do server-side routing and easily parse the URL.
Dude! Exactly, that would be awesome. And Splitting it out into its own element is probably even better. The simplicity and flexibility would be really powerful.
Was tinkering and came up with an interesting use case to throw out there. It would be interesting if, instead of loading elements or templates, a matching route could simply output its value. Code example:
another with a little more complexity:
What would be interesting here is that the user could implement whatever mechanism desired for generating UI. The
<flatiron-director></flatiron-director>
examples tend to go this route, passing the path out of flatiron, but not having the benefits of matching variables. They are always very simple from what I've seen.So being able to do this:
Its an interesting idea.