Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How Polymer handle elements' model communication? #1187

Closed
Colstuwjx opened this issue Feb 13, 2015 · 6 comments
Closed

How Polymer handle elements' model communication? #1187

Colstuwjx opened this issue Feb 13, 2015 · 6 comments

Comments

@Colstuwjx
Copy link

HI, I am new to polymer, and I just wonder how to handle the model communication between two elements. It just like:

    <!-- this is the parent element which contain session model -->
    <polymer-element name="gaea-router" attributes="routers">
        <template>
            this is user {{  session.username }}
            <gaea-scaffold>...</gaea-scaffold>
        </template>
    </polymer-element>

    ...
    <!-- this is the child element -->
    <polymer-element name="gaea-scaffold">
        <template>
            <!--  How to get session model??? -->
            <!-- BTW, How to get the parent element attributes??? -->
        </template>
    </gaea-scaffold>

Wishes your reply, many thanks!!!

@cedric-marcone
Copy link
Contributor

Hello, @ebidel got you covered and wrote an article (Communication & Message Passing) on the polymer website. Every possible ways are described : binding, watchers, events & signals and using an element’s API.
https://www.polymer-project.org/articles/communication.html

@Colstuwjx
Copy link
Author

Thanks a lot to your reply!!!!

@dongyang03
Copy link

@donmccurdy
Copy link

donmccurdy commented Oct 25, 2016

Articles above are a 404 for me now, latest I can find is here:

https://docs-05-dot-polymer-project.appspot.com/0.5/articles/communication.html

^Although this refers to Polymer 0.5.

@arthurevans
Copy link

Two videos that might be helpful for general design principles:

Thinking in Polymer:
https://www.youtube.com/watch?v=ZDjiUmx51y8

Data Flow in Polymer Elements and Apps:
https://www.youtube.com/watch?v=pAW4YDLtPVs

@jfrazzano
Copy link

Is there a work around to get the hoist a new on a generator used to grab.

It allowed an app wide value handler to maintain state across elements and local moderators.

It kicks against the straight line down flow of the more recent data binding model

But it provided a shortcut in 2.0 to replicate some of the 1.5 data flow.

If not thanks for the work Arthur.

Sent from my iPhone

On Oct 26, 2016, at 7:41 PM, Arthur Evans [email protected] wrote:

Two videos that might be helpful for general design principles:

Thinking in Polymer:
https://www.youtube.com/watch?v=ZDjiUmx51y8

Data Flow in Polymer Elements and Apps:
https://www.youtube.com/watch?v=pAW4YDLtPVs


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants