Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ng-json-view

killzoner2.2kMIT4.0.0TypeScript support: included

A JSON View component for Angular 10+

angular, ng, json-view, ng-json-view

readme

Build Status

ng-json-view

A JSON View component for Angular 10+ (an angular based JSON display component)

installation

npm install ng-json-view --save

use

  • Install the dependency package:ng-json-view
npm install ng-json-view --save
  • Import in module NgxJsonViewModule
import { NgxJsonViewModule } from 'ng-json-view';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxJsonViewModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
  • Prepare JSON data
data = {
  "name": "ng-json-view",
  "url": "https://github.com/killzoner/ng-json-view",
  "string": "github",
  "number": 88,
  "boolean": true,
  "object": {
      "obj1": "obj1",
      "obj2": "obj2",
      "object": {
          "obj11": "obj11",
          "obj22": "obj22"
      },
      "emptyArray": []
  },
  "array": [
      1,
      2,
      3
  ],
  "date": new Date(),
  "null": null
};
  • Use on template page
<ngx-json-view [data]="data"></ngx-json-view>

Document

  • data - Object - Data
  • levelOpen - number - Initialize the number of layers to be expanded (initial value: 0)

stand by

  • If the project is helpful to you, please click on the star,Thank you
  • If you have ideas, questions, and bugs about the project, welcome to discuss.

changelog

2.2.0 Add fullTemplateTypeCheck compilation option, make it compatible Angular 7

2.1.0 Add levelLabels feature

2.0.0 Update to Angular 4 compilation format

1.1.0 (2017-04-30)

1.0.0 (2017-04-29)