td-json-formatter
renders a javascript object in JSON format the same way the chrome/firefox console would render it using console.log()
.
Hovering on nodes will bring out a preview tooltip of the first 5 objects/properties of the node.
The tree is collapsable/expandable so you can navigate through its nodes.
Import the [CovalentJsonFormatterModule] in your NgModule:
import { CovalentJsonFormatterModule } from '@covalent/core/json-formatter'; @NgModule({ imports: [ CovalentJsonFormatterModule, ... ], ... }) export class MyModule {}
Simply add the component and pass the object to be formatted as a [data] input.
Example for HTML usage:
<td-json-formatter [data]="object" key="root" [levelsOpen]="1"> </td-json-formatter>