Template.abstract.helpers({
name: "abstract",
hello: function() {
return "Hello my name is ";
}
});
Template.abstract.copyAs('foo');
Template.abstract.copyAs('bar');
//Template.foo.__helpers = jQuery.extend( {},Template.abstract.__helpers );
//Template.bar.__helpers = jQuery.extend( {},Template.abstract.__helpers );
Template.foo.helpers({
name: "foo"
});
Template.bar.helpers({
hello: function() {
return "Ahoy-hoy my name is ";
}
});
With the preceding code I would expect the following template renderings:
Abstract: "Hello my name is abstract"
foo: "Hello my name is foo"
bar: "Ahoy-hoy my name is abstract"
Instead I get:
Abstract: "Hello my name is abstract"
foo: "foo"
bar: "Ahoy-hoy my name is"
In stepping through the code it appears as though the inheritsHelpersFrom portion of copyAs is not correctly copying the abstact helpers to the foo and bar classes. Manually copying the helpers over by uncommenting the two lines of code in the preceding example seems to fix this.
The copyAs and inheritsHelpersFrom functions don't work as expected. I'm not sure if this is an issue with the package or my expectations.
With the preceding code I would expect the following template renderings:
Abstract: "Hello my name is abstract" foo: "Hello my name is foo" bar: "Ahoy-hoy my name is abstract"
Instead I get:
Abstract: "Hello my name is abstract" foo: "foo" bar: "Ahoy-hoy my name is"
In stepping through the code it appears as though the inheritsHelpersFrom portion of copyAs is not correctly copying the abstact helpers to the foo and bar classes. Manually copying the helpers over by uncommenting the two lines of code in the preceding example seems to fix this.