Open ghost opened 7 years ago
IMO Accessing to this field using some static utility make much more sense. The model is only available if the handler is in a dom-repeat
, this cannot be expressed using the type-system so it just better to force the user to call the method itself. This actually matches perfectly with the alternative strategy proposed by polymer this.$.domRepeat.modelForElement(event.target)
.
Declarative event handlers inside a "dom-repeat" add the model object to the event. If we make the model available on the elemental.Event then it is possible to get the data from the item when an event is fired.
Example: So if the "dom-repeat" template contains an event handler (a.e.
<paper-button on-tap="onTapFct">
) then we get the binded data on each event.