Angular tree and tree-dropdown components for displaying and selecting from hierarchical entity data. Supports branch/leaf entity configurations, junction table relationships, keyboard navigation, and a BeforeX/AfterX event system.
Installation
npminstall@memberjunction/ng-trees
Overview
The tree package provides two components: a standalone tree view (mj-tree) and a dropdown variant (mj-tree-dropdown). Both load data from MemberJunction entities using RunView, support branch (category/folder) and leaf (item) entity configurations, and handle many-to-many relationships through junction table configuration.
flowchart TD
subgraph Config["Entity Configuration"]
A["TreeBranchConfig (categories)"]
B["TreeLeafConfig (items)"]
C["TreeJunctionConfig (M2M)"]
end
subgraph Components["Components"]
D["TreeComponent (mj-tree)"]
E["TreeDropdownComponent (mj-tree-dropdown)"]
end
subgraph Data["Data Loading"]
F["RunView API"]
G["Branch Hierarchy"]
H["Leaf Items"]
I["Junction Records"]
end
Config --> D
Config --> E
D --> F
F --> G
F --> H
F --> I
style Config fill:#2d6a9f,stroke:#1a4971,color:#fff
style Components fill:#7c5295,stroke:#563a6b,color:#fff
style Data fill:#2d8659,stroke:#1a5c3a,color:#fff