Angular:来自 json 数据的树视图 [英] Angular: tree view from json data

查看:25
本文介绍了Angular:来自 json 数据的树视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 angular 的新手.我想在 angular 5 中创建一个可扩展的树.我尝试使用 Angular-tree-component 和 ngx-treeview.但他们的问题是他们需要特定格式的 json.是否有任何库可以读取任何类型的 json 并创建一个可扩展的树?还是我需要将我的 json 转换为 npm 模块需要的格式?

I am new to angular. I want to create a expandable tree in angular 5. I have tried to using Angular-tree-component and ngx-treeview. but the problem with them is they need a json in specif format. is there any library which reads a any type of json and creates a expandable tree ? or do I need to convert my json in the format this npm modules will need it ?

我想做类似 tree-grid-directive(http://khan4019.github.io/tree-grid-directive/test/treeGrid.html) 在 angular js 1 中提供.

I want to do something like tree-grid-directive(http://khan4019.github.io/tree-grid-directive/test/treeGrid.html) is providing in angular js 1.

推荐答案

我使用 https://www.npmjs.com/package/angular4-jsoneditor.我在查看模式下使用它.

I solved my problem by using https://www.npmjs.com/package/angular4-jsoneditor. I am using it in view mode.

这篇关于Angular:来自 json 数据的树视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆