erikringsmuth / app-router

Router for Web Components
https://erikringsmuth.github.io/app-router/
MIT License
610 stars 83 forks source link

Binding with custom names #163

Open oesleik opened 7 years ago

oesleik commented 7 years ago

I'm not able to reproduce properly the binding example. When I try to use some custom name other than id, it doesn't set the attributes.

<app-router mode="hash">
    <app-route path="/binding/:id" element="page-test"></app-route>
    <app-route path="/notbinding/:orderId" element="page-test"></app-route>
</app-router>
window.onload = function() {
    document.registerElement('page-test', {
        prototype: Object.create(HTMLElement.prototype, {
            createdCallback: {
                value: function() {
                    console.log(this, this.attributes);
                }
            }
        })
    });

    document.querySelector("app-router").init();
};

When I open #/binding/25 it set the id attribute, but when I open #/notworking/25, it doesn't set the orderId attribute.

web-padawan commented 7 years ago

Why using notbinding in markup and notworking url?

oesleik commented 7 years ago

A typo