I'm just starting to learn Polymer. Here is a generic version of my polymer element:
<polymer-element name="my-element">
<template>
<style>
:host {
position:absolute;
width: 200px;
height: 100px;
background-color: green;
}
</style>
<p>my element</p>
<content id="first-in"></content>
<content id="second-in"></content>
</template>
<script>
Polymer('my-element', {
domReady: function() {
alert(this.children[0].getAttribute('title'));
//this returns the value I want to observe
}
});
</script>
<polymer-element>
The content tags are both being filled with another custom element (again slightly simplified):
<polymer-element name="in-element" attributes="title">
<template>
<style>
...
</style>
<p>{{title}}</p>
</template>
<script>
Polymer('in-element', {
title: 'me'
});
</script>
<polymer-element>
What I want to be able to do is call a function in my-element when the title attribute in (any) in-element (put in the content tag) is changed (by a click event or whatever). I'm not sure how to access this using observe or if I need to use mutationObserver, etc. How is this done/Is it possible?