1

I'm trying to pass an attribute's value from a parent element into it's children,

here is what I'm trying to do :

the parent/child elements that I'm using are defined like this :

<parent-element  parent-attr="first"> 

<child-one child-attr="{{parent-attr}}"></child-one>
<child-two child-attr="{{parent-attr}}"></child-two>
...

</parent-element>

Inside parent element :

<dom-module id="parent-element">
    <template>
            <content parent-attr="{{parent-attr}}"></content>
    </template>
    <script>
        Polymer({
            is: "parent-element",
            properties: {
                parentAttr:{
                    type: String,
                }
            }
        });
    </script>
</dom-module>

Inside the child element :

<dom-module id="child-one">
    <template>
            <content child-attr="{{child-attr}}"></content>
    </template>
    <script>
        Polymer({
            is: "child-one",
            properties: {
                childAttr:{
                    type: String,
                }
            }
        });
    </script>
</dom-module>

Thank you in advance

Soheil
  • 31
  • 8

0 Answers0