如何迭代Array包含Array

时间:2016-09-03 10:11:17

标签: angularjs

[
    {
        "key":"ntd",
        "value":
            [
                ["a","b","c"],
                ["x","y","z"],
            ]
    }
 ]

我想在ng-repeat中迭代上面的JSON并打印为[" a"," b"," c"],[&# 34; X"" Y"" Z"]

<div ng-repeat="r in value.value">
   //code goes here
</div>

1 个答案:

答案 0 :(得分:0)

使用嵌套的ng-repeat

就像下面一样
<div ng-repeat="r in data">
   <div ng-repeat="(key, value) in r.value">
      Key: {{r.key}}
      <div ng-repeat="v in value">
         {{v}}
      </div>
   </div>
</div>

Demo Plunkr