For instance in the below, only the foo
event handler is called. (Which is odd – I would have expected the bar
event handler to be called, since the <form>
element is in the bar
template.)
<template name="foo">
{{#bar klass="down"}}
<button type="submit">test</button>
{{/bar}}
</template>
<template name="bar">
<form>
{{> Template.contentBlock}}
</form>
</template>
Template.foo.events
'submit form' ->
alert 'foo'
Template.bar.events
'submit form' ->
alert 'bar'
The answer of how to do so is the code in the question, which in fact works as desired. The bar
handler is called, followed by the foo
handler.