我有阵列
self.CompareSignArray = ko.observableArray([“& gt”,“& le”]);
并选择选项
<select data-bind="options: $root.CompareSignArray,value: Sign" ></select>
但是在下拉列表中我看到了&amp; gt&amp; le,但我希望看到“&gt;”并且≤ 什么解决问题
答案 0 :(得分:1)
只需将你的角色添加到数组中:
self.CompareSignArray = ko.observableArray([">", "≤"]);
见这里:http://jsfiddle.net/V4GvT/
<强> HTML 强>:
<select data-bind="options: CompareSignArray" ></select>
<强> JS 强>:
function viewmodel()
{
var self = this;
self.CompareSignArray = ko.observableArray([">", "≤"]);
}
ko.applyBindings(new viewmodel());
答案 1 :(得分:0)
这是JS。使用常规字符,例如here:
self.CompareSignArray = ko.observableArray([">", "<"]);