Polymer element is defined as follows:
<polymer-element name="my-element">
<template>
<template if="{{show==true}}">
<div on-click="{{hideMe}}"> click to hide my div </div>
<div id="mydiv">
my div content here
</div>
</template>
</template>
</polymer-element>
And Dart code is as follows:
@CustomTag('my-element')
@observable bool show = true;
hideMe(){
Element e = $['mydiv'];
e.hidden = true;
}
Code does not work as $['mydiv'] returns null. How to find an element in nested template in Dart polymer component?