Here's an example which adds a listener to the element itself and then
alerts the event target's textContent: http://jsbin.com/getem/4/edit


On Mon, Aug 25, 2014 at 7:16 PM, 'Steve Orvell' via Polymer <
[email protected]> wrote:

> It's best not to directly touch elements rendered via a template repeat.
> To do so you'd need to setup a MutationObserver and possibly deal with the
> elements being removed.
>
> For this use case you can leverage event bubbling to delegate the event up
> the tree to a declarative event handler in the dom above the individual
> template items. You can then use event.target or possibly event.path to get
> the target of interest.
>
>
> On Mon, Aug 25, 2014 at 6:45 PM, <[email protected]> wrote:
>
>> EDIT TO ORIGINAL POST: I did not mean to include the on-click event on
>> the div in my code. This was for an example of where the on-click event
>> should be.
>>
>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Polymer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/polymer-dev/231d8198-1f2f-47ec-a934-57346fb19c54%40googlegroups.com
>> <https://groups.google.com/d/msgid/polymer-dev/231d8198-1f2f-47ec-a934-57346fb19c54%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  Follow Polymer on Google+: plus.google.com/107187849809354688692
> ---
> You received this message because you are subscribed to the Google Groups
> "Polymer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/polymer-dev/CA%2BrMWZhb%3DUQe0ArGbgUJ%3DUvmAoavj6aM6diMvK3CNzJMA%3DNE1w%40mail.gmail.com
> <https://groups.google.com/d/msgid/polymer-dev/CA%2BrMWZhb%3DUQe0ArGbgUJ%3DUvmAoavj6aM6diMvK3CNzJMA%3DNE1w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CAJj5OwD-jBzPoX%3Dh%2BwGjR_%2BbjQpgAc%2BBnnzU9Wmuut%2Bij4kwLg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to