0
我面臨我的代碼的邏輯問題: 我在我的AngularJS應用程序中使用modalbox(bootstrapUI)作爲ngTemplate。在ngTemplate裏面,我需要顯示一個嵌套的樹狀分層結構(這意味着我將不得不使用ngTemplate內ngTemplateAngularJS ng-template樹形結構ng-template內
這裏是樹的數據的JSON結構:
{
"DROPBOX": {
"/": {
"name": "/",
"source": "DROPBOX",
"identifier": "none",
"children": {
"9 th grade class": {
"name": "9 th grade class",
"source": "DROPBOX",
"identifier": "046ec8907f797029735b293f2fed8df5",
"children": {}
},
"Documents": {
"name": "Documents",
"source": "DROPBOX",
"identifier": "none",
"children": {
"test": {
"name": "test",
"source": "DROPBOX",
"identifier": "264854fc64d1e0d410e78e0488cab8b8",
"children": {}
}
}
},
"Photos": {
"name": "Photos",
"source": "DROPBOX",
"identifier": "none",
"children": {
"Sample Album": {
"name": "Sample Album",
"source": "DROPBOX",
"identifier": "6024199d9d312ba8347f515675321564",
"children": {}
}
}
},
"some folder with a very very very very very very very long name": {
"name": "some folder with a very very very very very very very long name",
"source": "DROPBOX",
"identifier": "700e932df5e5a678220b5e82e85dc2b2",
"children": {}
},
"testhierarchy": {
"name": "testhierarchy",
"source": "DROPBOX",
"identifier": "none",
"children": {
"child": {
"name": "child",
"source": "DROPBOX",
"identifier": "748961a8a3502a48bd4082cd2c0339eb",
"children": {}
}
}
}
}
}
}
}
TL; DR的JSON被構造爲
data.dropbox - {name: 'example', children: [ {name: 'asd', ]}
所以我的幫助將非常感激。
我在stackoverflow上找到了這個東西的遞歸指令 –