Here’s my code:
{{#collection contentBinding="someArray"}}
{{#view valueBinding="view.content"}}
<a>{{view.value}}</a>
{{/view}}
{{/collection}}
I want to add a click event for the above view tag, How should I accomplish this? I tried the following way but of no use:
{{#collection contentBinding="someArray"}}
{{#view valueBinding="view.content" clickBinding="someFunction"}}
<a>{{view.value}}</a>
{{/view}}
{{/collection}}
Try
<a {{action eventHandler target="view"}}>,eventHandlerbeing a function in the view that takes anevent. You can pass a context if necessary:<a {{action eventHandler this target="view"}}>, (the current handlebars context in the case ofthis) which would be accessible withevent.contextin the handler.