我正在使用敲除将视图绑定到视图模型。
我有我的看法
<table>
<tr>
<td data-bind ="text: ConcenatedData"></td>
</tr>
</table>
我的视图模型进行 ajax 调用并将数据绑定到可观察数组
function showData() {
return $.ajax({
url: "../Service/EmpData",
type: "PUT",
contentType: 'application/json',
processData: false,
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(errorThrown);
},
success: function (allData) {
var Data = $.map(allitems, function (item) {
return new EmpList(item);
});
self.EmployeeData(Data);
}
});
}
function EmpList(items) {
this.EmpName = ko.observable(data.EmpName);
this.EmpId = ko.observable(data.EmpId);
this.ConcenatedData = ko.observable(data.ConcenatedData);
}
我在我的 observable 中得到数据<temp>Is this Emp required</temp>in our company
所以我想让标签之间的文本加粗 <temp> and </temp>.
所以输出将是我们公司需要这个Emp吗?
如何做到这一点?
更新
我在这里创建了小提琴我希望标签之间的文本 <temp> and </temp>.
是粗体的。