如何在angularjs中显示嵌套字典

时间:2015-01-12 06:21:47

标签: angularjs angularjs-ng-repeat

如何使用angularjs ngRepeat显示它们。

结果:{     " keshvica":{       " google":4,       " sbi":0     },     " pragti":{       " facebook":3,       " vogella":5,       " wikipedia":1     } }

1 个答案:

答案 0 :(得分:0)

<div ng-repeat="(key, value) in dict">
         {{key}} : {{value}} 
       <div ng-repeat="(key1, value1) in value">
        {{key1}} : {{value1}} 
       </div>
 </div>

其中

$scope.dict = { "keshvica": { "google": 4, "sbi": 0 }, "pragti": { "facebook": 3, "vogella": 5, "wikipedia": 1 } }