Created
September 23, 2015 00:22
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this may have a little problem with styling control when in dom-repeat.