If I have an observable array
foos = [{ name: \"a\" }, { name: \"b\" }, { name: \"c\" }]
on my viewmodel, I would like to render the follow
As there is not currently a way to tell the template binding where to render the template, I don't see a cleaner way to do it right now other than something like:
So, we are passing the first item in your array as templateOptions and checking for if the item that we are dealing with in the template is indeed the first.
Sample here: http://jsfiddle.net/rniemeyer/XuXcr/
Also templateOptions was added after 1.12 KO, so you would need current code. More info about templateOptions here.
Hope this helps.