I found an error in my code, but I wonder if you guys think it should theoretically work.
I have a base layout template. To simplify it down, it looks like this
<template name="layout">
{{>yield "outer"}}
{{#ionView}}
{{#ionContent}}
{{>yield}}
{{/ionContent}}
{{/ionView}}
</template>
Now I have a template that I am loading.
<template name="productList">
{{contentFor "outer"}}
<input type="text" id="search"/>
{{/contentFor}}
{{#ionList}}
// this stuff doesn't matter
{{/ionList}}
</template>
So I try to bind events to this Template.
Template.productList.events({
'keyup input#search': _.throttle(function() {
// not important
}, 500)
});
This doesn’t seem to work. However, if I use Template.layout.events
, it will. Is this expected behavior? Seems logical to me that “outer” would fall under the scope of productList
when defining the contentFor
. The most specific one could take precedence. Or at least some way to configure that.