在这个 AngularJS 关联数组(键值对数组)中,ng-repeat 无法正常工作。怎么了?
function TestCtrl($scope) {
$scope.list = [];
$scope.processSomeData = function(){
$scope.list["testKey"]={};
$scope.list["testKey"]["test"]="Test value";
};
$scope.processSomeData();
}
<div ng-app>
<h2>Test</h2>
<div ng-controller="TestCtrl">
<div ng-repeat="(key,value) in list">
{{key}}
{{value.test}}
</div>
</div>
</div>
谢谢!