Question

my polymer element:

<ele-label id="newLabel" color="#000000" bgColor="#f1f1f1"  eleHeight="30" eleWidth="50" text="Name:" eleDisplay="inline-block"  elefloat="left"></ele-label>

but when I clone this element inner html will removed.

can any one help me ?

<polymer-element name="ele-label" attributes="text color eleid eleWidth eleHeight fontSize bgColor paddingTop paddingBottom paddingLeft paddingRight eleDisplay elefloat" > <template> <div><label style="font-size:{{fontSize}}pt; color:{{color}} ;">{{text}}</label></div> </template></polymer-element>
Was it helpful?

Solution

finally got solution

polylabel1 : id of my div in side template of polymer element.

 Polymer('ele-label', {
 ready: function()
        {
            this.innerHTML=this.$.polylabel1.outerHTML;
        }
 attributeChanged: function()
        {
            this.innerHTML=this.$.polylabel1.outerHTML;
        }
}

OTHER TIPS

When using the <template> tag in Polymer, it creates a shadow DOM, which is not part of the main DOM. You won't see the elements in the DOM itself, because it's not there. Take a look at the article i linked to learn more.

EDIT: It sounds like jQuery is not cloning the element's shadow with it. Try using .clone(true) to also clone related data.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top