javascript - Special characters in bound knockout data model -


i have data model special characters in (degree signs).. property contains following: "48 ° f". however, when ui updates data, see "°", not degree sign. have tried "°", doesn't work either.

how put special characters in data model , have them appear on ui?

you should use html binding this:

<span data-bind="html: test"></span>  var vm = {     test: ko.observable("48 &deg; f") };  ko.applybindings(vm); 

here working fiddle: http://jsfiddle.net/svu82/

read more in ko documentation: http://knockoutjs.com/documentation/html-binding.html


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -