Reputation: 33
The question is simple (I hope so). Is there a way to call the function myFunctA of my-elementA from my-elementB? Or any solution that works similarly to how public functions work in Java or C?
<polymer-element name="my-elementA">
<template>
...
</template>
<script>
Polymer({
myFunctA : function()
{
...
}
});
</script>
</polymer-element>
<polymer-element name="my-elementB">
<template>
<my-elementA></my-elementA>
...
</template>
<script>
Polymer({
myFunctB : function()
{
//call myFunctA()
}
});
</script>
</polymer-element>
Upvotes: 3
Views: 6133
Reputation: 2016
<polymer-element name="my-elementB">
<template>
<my-elementA id="element"></my-elementA>
...
</template>
<script>
Polymer({
myFunctB : function()
{
this.$.element.myFunctA();
}
});
</script>
</polymer-element>
Upvotes: 8