I have a data model with special characters in it (degree signs).. so the property contains the following: "48 °
f". However, when the UI updates to this data, I see the "°
", not the degree sign. I have also tried "°
", but that doesn't work either.
How do I put special characters in the data model and have them appear on the UI?
You should use html
binding for this:
<span data-bind="html: test"></span>
var vm = {
test: ko.observable("48 ° f")
};
ko.applyBindings(vm);
Here is a working fiddle: http://jsfiddle.net/svu82/
Read more in the KO documentation: http://knockoutjs.com/documentation/html-binding.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With