Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngx-json-view

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-json-view

A JSON View component for Angular 2+

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-16.67%
Maintainers
1
Weekly downloads
 
Created
Source

ngx-json-view

A JSON View component for Angular 2+ (基于angular 2+ 的JSON展示组件)

安装

npm install ngx-json-view --save

使用

  • 安装依赖包:ngx-json-view
npm install ngx-json-view --save
  • 在module导入NgxJsonViewModule
import { NgxJsonViewModule } from 'ngx-json-view';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    NgxJsonViewModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
  • 准备JSON数据
data = {
  "name": "twp0217",
  "url": "https://github.com/twp0217",
  "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
};
  • 在模板页面使用
<ngx-json-view [data]="data"></ngx-json-view>

文档

  • data - Object - 数据
  • levelOpen - number - 初始化展开层数(初始值:0)

支持

  • 如果项目对你有帮助,请点颗星:star:,谢谢。
  • 如果你对项目有想法、问题、BUG,欢迎讨论。

Keywords

FAQs

Package last updated on 30 Apr 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc