简体   繁体   English

PrimeNg Angular9 我正在使用 p-tree 自定义 api 并且它不工作

[英]PrimeNg Angular9 i am using p-tree custom api and its not working

I am trying to fill p-tree [value] with custom api how can i do it with template.我正在尝试用自定义 api 填充 p-tree [值] 我该如何使用模板来完成。 this is the api这是 api

0: {company: "abc", name: "testGroup1",…}
company: "abc"
id: 1
name: "testGroup1"
subGroups: [{parentId: 1, name: "Business support division", id: 1}, {parentId: 1, name: "campaign", id: 3}]
0: {parentId: 1, name: "Business support division", id: 1}
id: 1
name: "Business support division"
parentId: 1
1: {parentId: 1, name: "campaign", id: 3}
id: 3
name: "campaign"
parentId: 1
1: {company: "abc", name: "testGroup2", subGroups: [{parentId: 2, name: "Billing", id: 2}], id: 2}
company: "abc"
id: 2
name: "testGroup2"
subGroups: [{parentId: 2, name: "Billing", id: 2}]
0: {parentId: 2, name: "Billing", id: 2}
id: 2
name: "Billing"
parentId: 2```

这是我能做的

now i dont know how to show the children(which is subGroups ) of the testGroup1 and the children of testGroup2 and also show the icons现在我不知道如何显示 testGroup1 的子项(即subGroups )和 testGroup2 的子项并显示图标

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM