我有这段代码重复多次。
<div ng-controller="MyCtrl">
<div ng-repeat="item in test{{c}}.collection">
{{ item.hwTypeName }}
</div>
</div>
及以下是此
的控制器中的代码function MyCtrl($scope) {
$scope.searchParameters = {userName: '', userEmail: ''};
var c=123;
var test="test"+c
$scope[test].collection = [{"ticketHardwareId":3817987,"requestId":3854951,"hwId":64543,"hwPrice":0,"assetId":"98ifgh","hwTypeName":"HW Type-1"}]
}
但这不起作用,可能有什么问题请帮忙
答案 0 :(得分:1)