Any more thoughts on a containerless text binding?

143 views
Skip to first unread message

simon.w...@gmail.com

unread,
Apr 10, 2012, 11:53:42 AM4/10/12
to knock...@googlegroups.com
Hi,

I am converting a project from jsRender to Knockout to try the native templating system. I am trying to dynamically generate some code that will be displayed in a pre block. 

This only seems possible by either:

1. Constructing a computed observable for the contents of the pre, or:
2. Creating a template full of spans. 

I have demonstrated both options here: http://jsfiddle.net/afSLH/5/

The example I have presented is greatly simplified but even in that case I think the spans look quite messy. I would like to use a containerless text binding as mentioned in the comments here: http://blog.stevensanderson.com/2011/08/31/knockout-1-3-0-beta-available/ 

It seems that this is the only reason that you might want to use an external templating library like jsRender, so I was wondering if anyone had investigated the containerless text binding any further? If not what is the best way of integrating jsRender and Knockout at the moment?

Really enjoyed trying out Knockout!

Simon



Michael Best

unread,
Apr 10, 2012, 8:46:24 PM4/10/12
to KnockoutJS
Check out my fork of Knockout that includes support for containerless
text binding:

https://github.com/mbest/knockout

On Apr 10, 5:53 am, simon.woodh...@gmail.com wrote:
> The example I have presented is greatly simplified but even in that case I
> think the spans look quite messy. I would like to use a containerless text
> binding as mentioned in the comments here:http://blog.stevensanderson.com/2011/08/31/knockout-1-3-0-beta-availa...

Simon Woodhead

unread,
Apr 11, 2012, 12:04:08 PM4/11/12
to knock...@googlegroups.com
That is fantastic Michael, thank you. Are there plans to incorporate this in a future release?

Simon

Michael Best

unread,
Apr 11, 2012, 5:30:37 PM4/11/12
to KnockoutJS
Yes. I'm not sure what the time frame will be.
Reply all
Reply to author
Forward
0 new messages