I have a "paper-dialog" object in a page. I can toggle it by a button if it is not inside a "dom-repeat" loop. But if I put it in a loop, "this.$.dialog.toggle();" will then referring to null.
<template is="dom-repeat" items="{{news}}" index-as"index">
<paper-dialog id="dialog"><h3>{{item.date}}</h3></paper-dialog>
<paper-button on-tap="toggleDialog">View {{item.name}}</paper-button>
</template>
and
toggleDialog: function(e) {
this.$.dialog.toggle();
}
Any idea why "this.$.dialog" become null after placing the dialog in a loop?