primeNg get Nodes attribute



我有这个json输出:

{
"data":
[
{
"label": "The Avengers",
"data": { "name" : "The Avengers", "type" : "book"},
"expandedIcon": "fa-folder-open",
"collapsedIcon": "fa-folder",
"leaf": true
},
{
"label": The Ring",
"data": { "name" : "The Ring", "type" : "movie"},
"expandedIcon": "fa-folder-open",
"expandedIcon": "fa-folder-open",
"collapsedIcon": "fa-folder",
"leaf": false
}
]
}

在我的模板中,我想获取每个节点的叶子值和 expandedIcon 属性,但我看不到该怎么做:

<ng-template pTemplate="body" let-rowNode let-rowData="rowData">
<tr>
<td>
<p-treeTableToggler [rowNode]="rowNode"></p-treeTableToggler>
{{rowData.title}}
</td>
<td>{{rowData.type}}</td>
<td>{{rowNode.leaf}}</td>
</tr>
</ng-template>

rowNode.leaf 为空。如何获得他的价值?因为我在文档中没有看到示例

谢谢

你需要

<td>{{rowNode.node.leaf}}</td>

一些参考

相关内容

  • 没有找到相关文章