Z
Z
zlodiak2020-06-13 20:52:53
JavaScript
zlodiak, 2020-06-13 20:52:53

How to view an object in marionette?

When I create an instance of a class from a view, I would like to see it through the console. To do this, I try to display it through console.log, but as a result I get the following error message:

<a class='gotoLine' href='#50:49'>50:49</a> Uncaught TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'n'
    |     property '_events' -> object with constructor 'Object'
    |     property 'before:attach' -> object with constructor 'Array'
    |     index 0 -> object with constructor 'Object'
    --- property 'ctx' closes the circle


Please tell me, is it still possible to see the contents of the new MyView () object?

LIVE DEMO

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-06-13
@zlodiak

Obviously don't try to use JSON.stringify. Throw the object into the console as is. Or, you will have to study its structure, and instead of a complete object, turn a copy of its part into a string, which will not contain cyclic references.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question