O'Reilly logo

Angular UI Development with PrimeNG by Oleg Varaksin, Sudheer Jonna

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Visualizing data with Tree

The Tree component is used to display a hierarchical representation of data in a graphical format. It provides an array of the TreeNode objects as its value. The TreeNode API provides many properties to create tree node objects. The tree structure has basically three major components as listed here:

  • The tree elements are called nodes
  • The lines connecting elements are called branches
  • The nodes without children are called leaf nodes or leaves

A basic example of a Tree component with nodes would be written as follows (the node will represent tourist places):

<p-tree [value]="basicTree"></p-tree>

The data for the Tree component should be provided in a nested parent-child hierarchy. Each tree node is created with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required