范围内定义的 JSON 数组:
$scope.faq = [
{"Question 1": "Answer1"},
{"Question 2": "Answer2"}
];
HTML:
<div ng-repeat="f in faq">
{{f}}
</div>
输出:
{"Question 1": "Answer1"}
{"Question 2": "Answer2"}
我希望输出看起来像什么:
Question 1 - Answer1
Question 2 - Answer2
它看起来应该如何工作:
<div ng-repeat="f in faq">
{{f.key}}-{{f.value}}
</div>
...但事实并非如此。