我想使用Knockout将结构绑定到从REST服务返回的分层JSON。采用以下形式:
[{
Name: "Page 1",
Children: [ {
Name: "Page 1 > 1",
Children: [{
Name: "Page 1 > 1 > 1",
Children: []
}
,{
Name: "Page 1 > 1 > 2",
Children: []
}
]
}
]
},
{
Name: "Page 2",
Children: [
{
Name: "Page 16",
Children: []
}
]
},
{
Name: "Page 3",
Children: [
{
LocalizedName: "aaaaa",
Children: []
}
]
标准(foreach)绑定仅返回顶级。有没有好办法呢?
感谢。