$scope.mainArray = []; $scope.subArray = []; var myObject = {} myObject.task = "write"; myObject.execute = true; for (var i = 0; i < $scope.mainArray.length; i++) { $scope.subArray[i] = myObject; $scope.mainArray[i] = $scope.subArray; }
如何使用角度js显示我的subArray中的元素?我正在使用指令ng-repeat来显示我的mainArray,如:ng-repeat =“mainArray中的元素”
喵喵时光机
呼啦一阵风
相关分类