flatiron-director
flatiron-director
is a web component for routing that wraps the flatiron director isomorphic URL router library.
Example
<flatiron-director route="{{route}}" auto-hash></flatiron-director>
flatiron-director
is a web component for routing that wraps the flatiron director isomorphic URL router library.
<flatiron-director route="{{route}}" auto-hash></flatiron-director>
demo.html does this:
Polymer('x-test', {
route: 'hello'
});
but the input box doesn't initialize to 'hello'.
If I change x-test to this:
Polymer('x-test', {
ready: function () {
this.route = 'hello';
}
});
then the input box does initialize to 'hello'.
Assuming that route: 'hello' was meant to initialize, why doesn't it?
I might be misusing the component, but it looks like <flatiron-director>
doesn't show the initial slash after the hash. URL becomes http://localhost:9000/#myroute
instead of http://localhost:9000/#/myroute
.
Shouldn't this.ready be:
ready: function() {
this.router.on(/(.*)/, function(route) {
this.route = this.router.delimiter + route;
}.bind(this));
this.route = this.router.getRoute() ? this.router.delimiter + this.router.getRoute().join(this.router.delimiter): '';
}
?
...therefore travis is unhappy...
Flatiron is great and even better with Polymer!
Can anyone think of a way we can add the ability to use the delimiter option on the router and bind multiple properties?
I was thinking of adding an options attribute to pass in things like {"strict":false, "delimiter":"-"}
, but there is still the matter of binding to router.on()
for multiple objects.
I don't understand the use of regexes with flatiron well enough yet.
This current doesn't have a dedicated component page, unlike some of our other elements. If there's interest in putting one together I wouldn't mind doing that.
Please merge one of the two pull requests for a Polymer 1.0 version into the master branch.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.