Skip to content

Instantly share code, notes, and snippets.

@duongphuhiep
Created September 23, 2015 00:22
Show Gist options
  • Save duongphuhiep/fda55adf1e042b46afc8 to your computer and use it in GitHub Desktop.
Save duongphuhiep/fda55adf1e042b46afc8 to your computer and use it in GitHub Desktop.
Polymer dom-repeat: use currentTarget to references to the item itself, not the sub-child
<template is="dom-repeat" items={{postsCollection}}>
<file-item content-type="post-folder" file-name={{item}} on-tap="clickHandle"></file-item>
</template>
<script>
clickHandle: function(e) {
e.currentTarget refers to <file-item>
e.target refers to the div inside <file-item>
}
<script/>
@Rubinhuang9239
Copy link

this may have a little problem with styling control when in dom-repeat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment