7

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

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?

2
  • you mean like this one, that appears as the first result when searching for angular2 tree component ? npmjs.com/package/angular2-tree-component Commented Sep 22, 2016 at 12:40
  • Actually, I want to display parent and child using "angular2 tree component" and also drag and drop one parent child to other.. Commented Sep 23, 2016 at 4:43

2 Answers 2

9

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

npm install angular2-tree-component

Sign up to request clarification or add additional context in comments.

4 Comments

I am using the same but not able to achieve. I am looking an example, where I can see and understand. Actually, I new in Angular 2 So..
There is documentation for that component here angular2-tree.readme.io/docs . Please consider marking this answer as accepted.
Hello @Alexander, Is it possible to drag and drop one parent's child node to other?
The developer says it will be supported in the future
2

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.

2 Comments

Great works man! One question, how do I dynamically add data to a node's children?
Really Simple and helpful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.