【发布时间】:2015-06-06 07:23:45
【问题描述】:
如果我运行微风投影查询:
var item;
breeze.EntityQuery
.from("SomeTable")
.where("Id", "==", id)
.select("A, B, C, D")
.using(myEntityManager).execute()
.then(function(data) { item = ko.observable(data.results[0]); });
并且说表中的行,B 和 C 为 NULL,我将取回一个没有 B 和 C 的对象。
{
A: "somevalue",
B: "someothervalue"
}
在我的 UI 中:
<div data-bind="with: item">
<span data-bind="text: A" />
<span data-bind="text: B" />
<span data-bind="text: C" />
<span data-bind="text: D" />
</div>
然后我得到错误 -
ReferenceError: Unable to process binding "with: function(){return item}“消息:无法处理绑定”文本: 函数(){返回 B}" 消息:“B”未定义
我错过了什么吗?如何在结果中获得值为 null 的 B 和 C?
【问题讨论】:
标签: knockout.js breeze