Ich habe eine Form, die zunimmt, wenn die Verwendung klicken Sie auf den Add Verkauf Buttonwie Eingabewert von der ng-repeat an den Controller bekommen
dies der html
<fieldset data-ng-repeat="choice in choices">
<div class="form-group">
<label for="name">
Quantity :
</label>
<input type="text" class="form-control" id="choice.quantity" ng-model="choice.amount" />
</div>
ist, wie kann ich der Eingangswert in meinem Controller
appcat.controller("MainCtrl", ['$scope', '$location', function ($scope, $location)
{
// this controll the addition and removal
$scope.choices = [{ 'amount': '' }];
// I want to set the input field
$scope.choice.amount = parseFloat(200* 4); // $scope.choice.amount and $scope.amount are not working
// this generate a form
$scope.addNewChoice = function()
{
var newItemNo = $scope.choices.length + 1;
$scope.choices.push({'amount': ''});
};
// this remove the form
$scope.removeChoice = function() {
var lastItem = $scope.choices.length - 1;
if ($scope.choices.length > 1) {
$scope.choices.splice(lastItem);
}
};
}
wie kann ich den Eingangswert dieser Berechnung eingestellt parseFloat(200* 4);
in meinem Controller