如何使用 Typescript 在 Angular 2 中创建 TreeView?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39639190/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 03:51:52  来源:igfitidea点击:

How to create TreeView in Angular 2 using Typescript?

angulartypescripttreeview

提问by Anil Singh

What should I do to create TreeView in Angular 2 using TypesScript?

我应该怎么做才能使用 TypesScript 在 Angular 2 中创建 TreeView?

I am trying to find out on Google but still not get any working example etc.

我试图在谷歌上找到,但仍然没有得到任何工作示例等。

Can anyone please share me example to achieve this task?

任何人都可以分享我完成这项任务的例子吗?

回答by Alexander Ciesielski

Why not use a ready made one, for example angular2-tree-component?

为什么不使用现成的,例如 angular2-tree-component?

npm install angular2-tree-component

npm install angular2-tree-component

回答by NicuVlad

You can check this article.

您可以查看这篇文章

It will help you to create a tree structure without a third party library. It works recursively and it has collapsible logic.

它将帮助您在没有第三方库的情况下创建树结构。它以递归方式工作,并且具有可折叠的逻辑。