I'm quite new to knockout.js and I couldn't find an answer for this question.
I'm trying to create something like
<td>DEMO<span>DEMO2</span></td>
But I'm not sure how to do it with knockout.js. I tried the following, but it didn't work:
<td data-bind="text: type"><span data-bind="text: type2"></span></td>
It seems text:type
is overriding the span
and it doesn't even appear.
Yes, you cannot have your
text
binding on thetd
because it completly overrides the content of yourtd
From the documentation:
Solutions:
Use an extra
span
:Use the contenerless syntax of KO:
Demo JSFiddle.