The problem here is that the inner tag is being rendered as a string, not as a data-linked tag, since the this.tagCtx.content.render()
call is simply calling the render method on the compiled template corresponding to the block content.
If you want to render as a data-linked tag, you need to call this.tagCtx.render()
.
In addition, in calling this.tagCtx.render()
you need the tag to render its content, and not another template. Setting template: "#testTemplate"
will cause the tag to use that template instead of the content. So what you need is something along these lines:
var template = $.templates("#testTemplate");
$.views.tags({
test: {
render: function() {
var tagCtx = this.tagCtx;
tagCtx.props.content = tagCtx.render();
return template.render(tagCtx.props, undefined, tagCtx.view);
}
}
});
You probably don't want to pass in tagCtx as context in the template.render(...)
call. You can pass in tagCtx.ctx, or simply undefined...