If you are utilizing the ngx-treeview package from npmjs, follow this link:
https://www.npmjs.com/package/ngx-treeview?activeTab=readme
Here's how your JSON should be formatted:
const itCategory = new TreeviewItem([{
"text": "JOURNEY",
"value": 1
}, {
"text": "INVENTORY ASSURANCE",
"value": 2
}, {
"text": "SENSOR ASSURANCE",
"value": 3
}, {
"text": "AVAILABILITY ASSURANCE",
"value": 4
}, {
"text": "ACTIONABLE",
"value": 5,
"children": [{
"text": "Invalid Sensor Values",
"value": 11
},
{
"text": "Management View",
"value": 12
},
{
"text": "Actionable",
"value": 13
},
{
"text": "Informational",
"value": 14
}
]
}, {
"text": "COMPLIANCE",
"value": 6
}, {
"text": "EXPENDITURE",
"value": 7
}, {
"text": "PROJECT",
"value": 8
}, {
"text": "REPORT",
"value": 9
}, {
"text": "ADMIN",
"value": 10,
"children": [{
"text": "Access & Authorization",
"value": 15,
"children": [{
"text": "List Roles",
"value": 20
},
{
"text": "User Role Mapping",
"value": 21
},
{
"text": "List User Role Mapping",
"value": 22
},
{
"text": "Menu Authorization to Role-Function ",
"value": 23
},
{
"text": "Site Management",
"value": 24
}
]
},
{
"text": "Master Data Management",
"value": 16,
"children": [{
"text": "Function Master",
"value": 25
},
{
"text": "Feature Master",
"value": 26
},
{
"text": "Site to State Mapping",
"value": 27
},
{
"text": "Unit Cost (EB & DG)",
"value": 28
},
{
"text": "R4G States",
"value": 29
}
]
},
{
"text": "Escalation Matrix",
"value": 17
},
{
"text": "Facility Management",
"value": 18,
"children": [{
"text": "Create Facility",
"value": 30
},
{
"text": "Create Sub Facility",
"value": 31
},
{
"text": "Partial Variance",
"value": 32
}
]
},
{
"text": "Create New Role",
"value": 19
}
]
}])
Additionally, configure your settings as follows:
{
hasAllCheckBox: true,
hasFilter: false,
hasCollapseExpand: false,
decoupleChildFromParent: false,
maxHeight: 500
}
Hopefully, these instructions will help you set up successfully.