• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ngx-json-view: A JSON View component for Angular 2+ (基于angular 2+ 的JSON展示组 ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

ngx-json-view

开源软件地址:

https://gitee.com/twp0217/ngx-json-view

开源软件介绍:

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,欢迎讨论。

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
reuse-tab: Angular Material reuse route tab发布时间:2022-02-14
下一篇:
ng-server: angular项目运行环境发布时间:2022-02-14
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap