saiki4116
saiki4116

Reputation: 323

JSON circular reference Angular Error

I am trying to implement a tree in AngularJS. I have to build the tree(i.e add nodes to tree), dynamically based on user input(from Angular Select). Here is the operation I want to do,

var a = { name : "concat", operands : [{method : {}},{method : {}}]}; a.operands[0].method = a;

When I try to do this kind of operation in AngularJS, I am getting RangeError: Maximum call stack size exceeded. is something wrong with this kind of operation.

I am getting this error, because the Array populating the dropdown is getting modified every time and causing this error. Sorry for the inconvenience.

Upvotes: 0

Views: 166

Answers (1)

Amit Thakkar
Amit Thakkar

Reputation: 787

I think, something is missing in your code. If you can share your code then I will be able to help more. Or you can checkout this blog. In this blog, we are creating a tree with two small directive. You can modify directive according to your requirement.

Upvotes: 1

Related Questions