I want to display organization structure using angular material tree with position, salary, year of services as properties.
class Employee {
name: string;
position: string;
salary: number;
yearofServices: number;
reports: Employee[];
}
For example,
[
{id: 1,
name:'employee1',
position: 'president',
salary: 250000,
yearofServices: 20,
reports: [
{
id: 2,
name:'employee2',
position: 'manager',
salary: 200000,
yearofServices: 10,
},
{
id: 3,
name:'employee3',
position: 'manager',
salary: 190000,
yearofServices: 15,
}
];
]
We want to display four columns:
Name Position Salary YearOfService
Name column is a tree structure according to organization reports hierarchy. For example, if a manager has three reports, the manager node will have three sub nodes.
Is it possible to do this using angular material tree control?