Skip to content Skip to sidebar Skip to footer

Html Entities With Knockout

How can I output HTML Entities in fields that are bound to a variable in the viewModel? I would like to display an HTML Entity like ← (←) in a field bound to a span in t

Solution 1:

You can use the html binding for something like this one. It would look like:

<p>Knockout: <spandata-bind='html: field.value'></span></p>

Sample: http://jsfiddle.net/rniemeyer/KES2j/1/

Post a Comment for "Html Entities With Knockout"