I have a simple p-tree populated with checkboxes. I’m able to render it okay – but clicking on the checkboxes doesn’t actually make them appear as checked.
Even if I do something as simple as this in the ts file and HTML file, respectively:
ts file:
myObjectNodes: TreeNode[] = [];
ngOnInit() {
const checkbox1 = {
label:"checkbox 1"
};
const checkbox2 = {
label:"checkbox 2"
};
this.myObjectNodes.push(checkbox1);
this.myObjectNodes.push(checkbox2);
}
HTML file:
<p-tree [value]="myObjectNodes"
selectionMode="checkbox">
It renders fine – but the checkboxes never display as checked no matter how many times you click them:
Any suggestions?