Nocturnal Pumpkin Maelstrom

    ngx-json-viewer
    TypeScript icon, indicating that this package has built-in type declarations

    3.0.2 • Public • Published

    ngx-json-viewer

    JSON formatter and viewer for Angular

    Live demo: https://stackblitz.com/edit/ngx-json-viewer

    Install

    npm install ngx-json-viewer

    or

    yarn add ngx-json-viewer

    For older Angular:

    # For Angular 4/5/6/7:
    npm install ngx-json-viewer@2
    
    # For Angular 2:
    npm install ngx-json-viewer@1

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

    Usage

    In your app.module.ts import NgxJsonViewerModule like

    import { NgxJsonViewerModule } from 'ngx-json-viewer';
    
    @NgModule({
      ...,
      imports: [
        ...,
        NgxJsonViewerModule,
        ...
      ],
      ...
    })
    export class AppModule { }

    In your component:

    <ngx-json-viewer [json]="someObject"></ngx-json-viewer>

    To collapse all nodes at first:

    <ngx-json-viewer [json]="someObject" [expanded]="false"></ngx-json-viewer>

    To only expand 3 levels:

    <ngx-json-viewer [json]="someObject" [depth]="3"></ngx-json-viewer>

    Keywords

    Install

    npm i ngx-json-viewer

    DownloadsWeekly Downloads

    29,223

    Version

    3.0.2

    License

    MIT

    Unpacked Size

    77.3 kB

    Total Files

    26

    Last publish

    Collaborators

    • hivivo