Data like this:
Print like this
Data like in image
If printing the object like
console.log(obj);
doesn't help, JSON.stringify is the method you are looking for:
console.log(JSON.stringify(obj));
From your comment in one answer:
I want to print on UI not in log
I assume you want to print on the web browser view instead?
In your html template you can do this:
<pre>{{ obj | json }}</pre>
(The <pre> tag preserves the spaces and prints object values neatly as in with hierarchy)
That will display the obj in the following format in the browser: