我的嵌套数组不是固定数组。它可以是每个级别中数组的n个数字
我的JSON对象将类似于
col1, col2
A 600
col3, col2
X 100
Y 200
B 1800
col3, col2
X 500
Y 600
所有[{
"name": "l-1",
"sub": [{
"name": "test-1",
"sub": []
},
{
"name": "test-2",
"sub": []
},
{
"name": "test-3",
"sub": [{
"name": "test-3.1",
"sub": []
}]
},
{
"name": "test-4",
"sub": [{
"name": "test-4.1",
"sub": []
},
{
"name": "test-4.2",
"sub": [{
"name": "test-4.2.1",
"sub": [{
"name": "test-4.2.2",
"sub": []
}]
}]
}
]
}
]
},
{
"name": "l-2",
"sub": []
},
{
"name": "l-3",
"sub": []
}
]
的嵌套数组的编号都将为sub
,如何在ngFor中打印此嵌套数组?我动态地尝试了它的角度,它打印了两个级别,只有我的代码在https://stackblitz.com/edit/angular-ivy-z6wpcs >