最大调用堆栈大小超过了同时结合微风结果剑道UI图表

最大调用堆栈大小超过了同时结合微风结果剑道UI图表

本文介绍了最大调用堆栈大小超过了同时结合微风结果剑道UI图表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的热毛巾模板的修改版本,以创建一个角度SPA。我使用的微风与小部件和图表剑道UI和数据即访问我的数据服务。

我面临着类似的问题,在此张贴SO Chrome//kendoUI/jQuery:最大调用堆栈大小超过。在我的微风劳务输出直接绑定到我的图表中,我得到的最长呼叫堆栈大小超过了以未捕获的错误在客户端上错误:[$ rootScope:infdig] 10 $摘要()迭代到达。中止在过去的5次迭代解雇了看守:[]

微风结果也有循环引用的是上面的链接也预示。我收到这个绑定到正常范围的角度不变量的问题,但只有在这种结合我的图表出现错误。在客户端过滤数据作为链接可能暗示会影响性能。我尝试了几个替代的功能和JSON.prune为好,但他们删除我需要显示的图表以及:(数据

是否有任何其他修复此?

完整的错误如下粘贴。看起来好像每个属性正在执行深拷贝,但因为有循环引用,它最终抛出一个溢出错误

 的RangeError:最大调用堆栈大小超过
    在Object.toString(原生)
    在IsArray的(HTTP://本地主机:61438 /脚本/ angular.js:596:19)
    在isArrayLike(HTTP://本地主机:61438 /脚本/ angular.js:278:27)
    在的forEach(HTTP://本地主机:61438 /脚本/ angular.js:324:16)
    在副本(HTTP://本地主机:61438 /脚本/ angular.js:871:7)
    在副本(HTTP://本地主机:61438 /脚本/ angular.js:858:23)
    在副本(HTTP://本地主机:61438 /脚本/ angular.js:875:28)
    在副本(HTTP://本地主机:61438 /脚本/ angular.js:858:23)
    在副本(HTTP://本地主机:61438 /脚本/ angular.js:875:28)
    在副本(HTTP://本地主机:61438 /脚本/ angular.js:858:23)angular.js:9778
(匿名函数)angular.js:9778
(匿名函数)angular.js:7216
范围$消化angular.js:12270
(匿名函数)angular.js:12450
completeOutstandingRequest angular.js:4300
(匿名函数)未捕获的错误:[$ rootScope:infdig] 10 $摘要()迭代到达。中止!
观察家在过去的5次迭代解雇:[]
http://errors.angularjs.org/1.2.16/$rootScope/infdig?p0=10&p1=%5B%5D angular.js:78
(匿名函数)angular.js:78
范围$消化angular.js:12290
(匿名函数)angular.js:12450
completeOutstandingRequest angular.js:4300
(匿名函数)


解决方案

这是因为微风实体具有相互引用和大多数供应商的网格不的绑定时停止的遍历属性。针对此修复程序使用投影这里描述 -

I am working on a modified version of the Hot Towel template to create an Angular SPA. I am using Breeze to access my data services with kendo UI and data viz for widgets and charts.

I am facing a similar issue to the one stated in this SO post Chrome//kendoUI/jQuery: Maximum call stack size exceeded. On binding my breeze service output directly to my chart, I get a Maximum Call Stack Size exceeded error on the client with 'Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!Watchers fired in the last 5 iterations: []'

Breeze results do have circular references as the link above also indicates. I receive no issues on binding this to normal angular scope variables, but the error occurs only upon binding this to my charts. Filtering data on the client as the link suggests probably will have a performance impact. I tried a couple of replacer functions and JSON.prune as well, but they remove the data that I need to display on the charts as well :(

Is there any other fix for this?

The complete error is pasted below. Looks as though a deep copy is being performed for each property, but since there are circular references, it ends up throwing an overflow error

RangeError: Maximum call stack size exceeded
    at Object.toString (native)
    at isArray (http://localhost:61438/Scripts/angular.js:596:19)
    at isArrayLike (http://localhost:61438/Scripts/angular.js:278:27)
    at forEach (http://localhost:61438/Scripts/angular.js:324:16)
    at copy (http://localhost:61438/Scripts/angular.js:871:7)
    at copy (http://localhost:61438/Scripts/angular.js:858:23)
    at copy (http://localhost:61438/Scripts/angular.js:875:28)
    at copy (http://localhost:61438/Scripts/angular.js:858:23)
    at copy (http://localhost:61438/Scripts/angular.js:875:28)
    at copy (http://localhost:61438/Scripts/angular.js:858:23) angular.js:9778
(anonymous function) angular.js:9778
(anonymous function) angular.js:7216
Scope.$digest angular.js:12270
(anonymous function) angular.js:12450
completeOutstandingRequest angular.js:4300
(anonymous function)

Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: []
http://errors.angularjs.org/1.2.16/$rootScope/infdig?p0=10&p1=%5B%5D angular.js:78
(anonymous function) angular.js:78
Scope.$digest angular.js:12290
(anonymous function) angular.js:12450
completeOutstandingRequest angular.js:4300
(anonymous function)
解决方案

This happens because the Breeze entities have references to each other and most vendor grids don't stop iterating over the properties when binding. A fix for this is using a projection as described here -

http://www.breezejs.com/documentation/knockout-circular-references

这篇关于最大调用堆栈大小超过了同时结合微风结果剑道UI图表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 11:52