I'm struggling with what was supposed to be simple and I can't get it. Is there a bug or is it just me? I've created two simple examples using two approaches: 1)registerHelper and 2)parentData: The HTML is:
<body>
This is the body
{{> A}}
</body>
<template name="A">
This is "A"
{{> B}}
</template>
<template name="B">
This is "B"
{{> C}}
</template>
<template name="C">
This is "C"
{{foo}}
</template>
And the Javascript for 1) is:
Template.registerHelper(foo, function () {
return 'Hello';
});
And for case 2) is:
Template.A.helpers({
foo: function () {
return 'Hello';
}
});
Template.C.helpers({
foo: function () {
return Template.parentData(2);
}
});
What is wrong?