我的数据如下所示。我尝试过键,但它不起作用。 我想在下拉列表中使用ng-repeat显示所有Product_Groups。 我正在使用
ng-repeat="value.Product_Group for (key, value) in pgroup track by $index"
答案 0 :(得分:0)
试试这个
<div ng-repeat="item in pgroup track by $index">
{{item.Product_Group}}
</div>
而不是
ng-repeat="value.Product_Group for (key, value) in pgroup track by $index"
<强>样本强>
var myApp = angular.module('myApp',[]);
myApp.controller('MyCtrl', function($scope) {
$scope.pgroup = [
{Product_Group: "TrueBeam"},
{Product_Group: "TrueBeam1"},
{Product_Group: "TrueBeam2"}
];
});
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="myApp" ng-controller="MyCtrl">
<div ng-repeat="item in pgroup track by $index">
{{item.Product_Group}}
</div>
</div>
&#13;