erikringsmuth / app-router

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

How to rewrite polymer element content with app-router? #76

Open Colstuwjx opened 9 years ago

Colstuwjx commented 9 years ago

Hi , I met an issue about app-router & polymer, it just likes:

    <gaea-scaffold username="test_user">
        <!--  here is some extra content -->
        <div class="ui steps">...</div>
    </gaea-scaffold>

    <!-- gaea-scaffold definition -->
    <polymer-element name="gaea-scaffold" attributes="username">
        <!-- content could be rewrite -->
        <core-scaffold>
            ...
            <content class="content">
            </content>
            ...
        </core-scaffold>
    </polymer-element>

    <!-- it works!! But turn to app-router, what it should be? -->
            <app-router>
            <app-route path="/" import="/static/Gaea/elements/gaea-scaffold.html" element="gaea-scaffold">
                <!-- add here?? I tried but it doesn't work... -->
                <div class="ui steps">...</div>
            </app-route>
        </app-router>

What should I do?? Wishes your reply.

erikringsmuth commented 9 years ago

Sorry, I'm really not sure what you're asking here.

Colstuwjx commented 9 years ago

I just wonder how to fill out the custom element's in app-router. Thanks.

popbee commented 9 years ago

Would the following syntax help you?

<app-route path="/">
    <template>
        <gaea-scaffold username="test_user">
            <!--  here is some extra content -->
            <div class="ui steps">...</div>
        </gaea-scaffold>
    </template>
</app-route>

As for the import, I do not know if you can have the import="/static/Gaea/elements/gaea-scaffold.html" when using a template tag. (I never tried it). I usually do all my imports at the top of the file, something like:

<link rel="import" href="/static/Gaea/elements/gaea-scaffold.html">