I am looping an array of objects. each object has name and address for example. On click event, i want to send the clicked name to the function.
Example: on-click="myFunc('[[item.name]]')"
My current code:
static get template() {
...
<template is="dom-repeat" items="[[users]]">
<a name="[[item.name]]" on-click="myFunc">[[item.name]]</a>
</template>
}
myFunc(name) {
console.log('Clicked name is ', name);
}
How to get the clicked name in the function myFunc
??