Frank
Frank

Reputation: 67

Polymer 1.0 event => (event, detail, sender)

In Polymer 0.5 I could do this

public action(event, detail, sender){
   var help = sender.getAttribute('data-action');

   // do something with this value
}

I got this value in Polymer 1.0 too. But I think this is not the official method

detail.sourceEvent.path[2].getAttribute('data-action')

Can somebody show me the official way ?

Upvotes: 0

Views: 214

Answers (1)

Frank
Frank

Reputation: 67

I got the solution. Just write:

event.currentTarget.getAttribute('data-action')

Upvotes: 2

Related Questions