Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
&引用;超过最大调用堆栈大小;将wijmo事件日历与Breeze一起使用时_Breeze_Wijmo - Fatal编程技术网

&引用;超过最大调用堆栈大小;将wijmo事件日历与Breeze一起使用时

&引用;超过最大调用堆栈大小;将wijmo事件日历与Breeze一起使用时,breeze,wijmo,Breeze,Wijmo,我在viewmodel中有以下代码: self.events = ko.observableArray(); function getAllEvents() { dataservice.events.getAll() .then(queryEventsSucceeded) .fail(queryEventsFailed); } function queryEventsSucceeded(data) { self.events(data.resu

我在viewmodel中有以下代码:

self.events = ko.observableArray();

function getAllEvents() {
    dataservice.events.getAll()
        .then(queryEventsSucceeded)
        .fail(queryEventsFailed);
}

function queryEventsSucceeded(data) {
    self.events(data.results);
}

function queryEventsFailed(error) {
    logger.logError(error.message, "Error retrieving events");
}
那么我有这样一种看法:

<div data-bind="wijevcal: { appointments: events }"></div>

我不知道发生了什么…

我猜Wijmo组件在遍历绑定对象图时无法处理具有循环引用的对象(例如,客户有订单,每个订单有客户)。即使没有导航属性的实体类型也具有循环引用

你必须找到打破这种循环的方法。你可以联系Wijmo的人,看看他们推荐什么


直接的解决方法并没有那么好:您必须将事件映射到一个中间对象(每个对象都是“ItemViewModel”),该对象正好公开绑定所需的信息。这是偶尔可以做的额外工作,但不是你想例行做的事。

你好,沃德。谢谢你的帮助。我想了解为什么一个显然没有循环引用的实例发生堆栈溢出异常。多亏了你的帮助,我现在明白了。我会联系wijmo的人。
self.events([{
    id: "event1",
    subject: "Green event.",
    start: new Date(2013, 4, 18, 9),
    end: new Date(2013, 4, 18, 11),
    allday: true,
    description: "The green event.",
    color: "green"
}]);