Durandal activationData nested in widget

149 Views Asked by At

I'm creating a Durandal widget and its works fine. My question is about activationData. It seems to be infinitely nested and I have no idea why.

If inspect the settings argument passed inside activate and drill down to activationData, the object keeps being nested within itself. Any idea why?

1

There are 1 best solutions below

0
On BEST ANSWER

It's not 'infinitely nested' it is simply referencing each other in what is called a circular reference in JavaScript. As long as you don't try to toJSON() it you should be fine, it's common practice.

Take a parent / child relationship for example -

Parent
  - Child

Child
  - Parent

A parent has a child which also has a parent. No biggie.