devdropper87 devdropper87 - 3 months ago 13x
AngularJS Question

debugging with pre tags - angularjs/reactjs

I use pre tags extensively to debug my code in angular js, like so:

<pre>{{vm.names | json}}</pre>

Two questions:

  1. how does this work under the hood?

  2. is there an equivalent tool
    with reactjs that lets you see variables' values in the view, instead
    of the more common console.logs/debuggers?


You can add <pre>{JSON.stringify(, null, 4)}</pre> to the Component holding state to "visualize" the data in your view.