[DEPRECATED] Angular 2 component for objects debug. Collapsible JSON in HTML with syntax highlight like Chrome DevTools
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Added expandAll Input and Behavior Oct 20, 2017
.editorconfig v1.2.2 Oct 17, 2017
.gitignore 🔥 v1.2.5: Trying to fix build Oct 18, 2017
LICENSE MIT License Oct 17, 2017
README.md 🍃 v1.2.5: Add link to Example source Oct 18, 2017
index.d.ts v1.2.4: return d.ts Oct 17, 2017
index.ts 🔥 v1.1.2: trying to fix Jul 6, 2017
package.json ✈️ v1.2.7: Expand all Oct 27, 2017
tsconfig.json v1.2.2 Oct 17, 2017
tslint.json v1.2.2 Oct 17, 2017

README.md

Angular 2 JSON Viewer Component t-json-viewer v1.2.0

Angular 2 component for objects debug. Collapsible JSON in HTML with syntax highlight like Chrome DevTools http://temich.in.ua/t-json-viewer/

Install

npm install t-json-viewer --save

NPM Package: https://www.npmjs.com/package/t-json-viewer

Usage

Import TJsonViewerModule to have access to following component

import {TJsonViewerModule} from 't-json-viewer';

@NgModule({
    ...,
    imports: [
        ...,
        TJsonViewerModule,
        ...
    ],
    ...
})
export class AppModule { }

Component

Takes an input [json] that can be data bound to any object.

@Component({
  ...,
  template: `
    <t-json-viewer [json]="asset"></t-json-viewer>
  `
  })
  export class MyComponent {
    ...
    ngOnInit() {
      this.asset = {};
      ...
    }
    ...
  }

Examples

Example: http://temich.in.ua/t-json-viewer/ Example source: https://github.com/temich666/t-json-viewer-example

Outputs

Angular 2 Pretty JSON with syntax highlight