<div ng-repeat="vehicle in vehicleList"> <div>{{vehicle.number}}</div> <input name="addName" value="add" ng-click="addVehicle($index, vehicle)"> <div ng-repeat="categoryList in vehicle.category"> <div>{{categoryList.name}}</div> </div></div>$scope.vehicleList = [];$scope.addVehicle = function(index, vehicle) { $scope.vehicleList[index].category.push({ name: vehicle });};
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)