erikringsmuth / app-router

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

Getting warnings: "Attributes on xx-xx were data bound prior to Polymer upgrading the element. This may result in incorrect binding types." #118

Open gjdev opened 9 years ago

gjdev commented 9 years ago

When using app-router in combination with custom polymer (0.5.5) elements , I get the following warning:

Attributes on hello-world were data bound prior to Polymer upgrading the element. This may result in incorrect binding types.

I get this for example with the following html:

<app-router mode="pushstate">
    <app-route path="/helloworld">
        <template>
            <hello-world />
        </template>
    </app-route>
</app-router>

Where the hello-world element is defined as follows:

<link rel="import" href="polymer/polymer.html"/>

<polymer-element name="hello-world" noscript>
    <template>
        <div>Hello World!</div>
    </template>
</polymer-element>
Mipme commented 9 years ago

Is there a reason why you use the template tag in the app-route? If you simply address the difference between tag name and path, just use the element attribute like this:

<app-router mode="pushstate">
  <app-route path="/helloworld" element="hello-world"></app-route>
</app-route>
gjdev commented 9 years ago

Yes this was just the simplest reproducing example. I like to put more content in the template.

mpoehler commented 9 years ago

I have the same problem, here the versions i'm working with:

"app-router": "~2.6.1", "pushstate-anchor": "~0.3.0", "polymer": "~0.5.6",

The warning only occurs after initialisation and calling the first routing. All further routings are working without warnings.

zbusia commented 9 years ago

For me it helped to initialize router manually after 'polymer-ready' like this:

<app-router init="manual">...</app-router>
<script>
    window.addEventListener('polymer-ready', function() {
        document.querySelector('app-router').init();
    });
</script>

See: https://erikringsmuth.github.io/app-router/#/api#init