Let me start with demonstration example: StackBlitz primeng p-tree.
I am using primeng to create a poll & answers kind of structure using p-tree.
So i have a herarchy like :
Participants --> Polls --> Questions --> Answers
Every Questions have answer options.
Array of list of nodes and childrens is as follows:
"label": "Bollywood",
"children": [
{
"label": "Do you prefer hollywood? [single]",
"children": [
{
"label": "Yes",
"selected": false
},
{
"label": "No",
"selected": true
}
]
}
]
I have added selected value to each of the children of answer options, so that for true values we can apply css to disthinigh among other options.
Screenshot below for current scenario:
I just want to highlight the options from the answers for which selected value is true. Purely looking with prospective of primeng p-tree control, i am curios to know how we can provide styiling to tree nodes. Please help me out, it will be grateful if you can go through the stackblitz example mentioned above. Thank you.