Socket
Book a DemoInstallSign in
Socket

@covalent/json-formatter

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@covalent/json-formatter

Teradata UI Platform JSON Formatter Module

latest
Source
npmnpm
Version
0.9.1
Version published
Maintainers
2
Created
Source

td-json-formatter

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.

API Summary

Properties:

NameTypeDescription
key?stringTag to be displayed as root of formatted object.
dataanyJS object to be formatted.
levelsOpen?numberLevels opened by default when JS object is formatted and rendered.

Setup

Import the [CovalentJsonFormatterModule] using the forRoot() method in your NgModule:

import { CovalentJsonFormatterModule } from '@covalent/json-formatter';
@NgModule({
  imports: [
    CovalentJsonFormatterModule.forRoot(),
    ...
  ],
  ...
})
export class MyModule {}

Usage

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>

Keywords

angular

FAQs

Package last updated on 23 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts