Angular.Copy返回的RangeError:最大调用堆栈大小超出。如何解决? [英] Angular.Copy returning RangeError: Maximum call stack size exceeded. How to resolve?

查看:294
本文介绍了Angular.Copy返回的RangeError:最大调用堆栈大小超出。如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个上限angular.copy?我有一个有点复杂的对象,我想复制和我得到的最大调用堆栈错误。

Is there an upper bound on angular.copy? I have a somewhat complex object that I would like to copy and I am getting the Max call stack error.

推荐答案

这可能是你有循环引用您自己的对象中。下面是一个情况的例子:

it's likely you have circular references inside your own object. Below is an example of a case:

var objectA = {};
var objectB = {};

//circular references
objectA.property = objectB; 
objectB.property = objectA;

$scope.object = {
  propertyA : objectA,
  propertyB: objectB
}

演示

这篇关于Angular.Copy返回的RangeError:最大调用堆栈大小超出。如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆