проверить это
var app = angular.module('app', []);
app.controller('appController', function ($scope, $http) {
$scope.Items = [
{'id':1,'name':'Apple','price':100,'qty':1},
{'id':2,'name':'Coconut','price':20,'qty':1}
];
$scope.proceed = function(){
data=$scope.Items;
alert(data);
};
});
HTML код:
<!DOCTYPE html>
<html ng-app="app" ng-controller='appController'>
<head>
<link rel="stylesheet" href="style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<form >
<table border="1">
<tr>
<td>Id</td>
<td>Name</td>
<td>Price</td>
<td>QTY</td>
<td>Data</td>
</tr>
<tr ng-repeat='Item in Items'>
<td>{{Item.id}}</td>
<td>{{Item.name}}</td>
<td>{{Item.price}}</td>
<td>{{Item.qty}}</td>
<td><input type="text" ng-init="{{Item.SubTotal = Item.price * Item.qty}}" name="Item.SubTotal" ng-model="Item.SubTotal" /></td>
</tr>
</table><br>
<input type="submit" ng-click="proceed()" />
</form>
</body>
</html>