I want to use AngularJS to calculate total price for product when I add Quantity. I have a code as below:
<div ng-app="TheApp">
<div ng-controller="TheController">
<input type="hidden" name="Price" value="100" ng-model="Price" />
<input type="text" name="Quantity" ng-model="Quantity" />
Total Price:{{TotalPrice}}
<button class="btn btn-primary btn-block" ng-click="click()">Add Items</button>
</div>
Inside my controller I have:
$scope.TotalPrice = $scope.Price * $scope.Quantity;
I know Angular does not support hidden but I am looking for the best practice to solve the issue. Please consider button is not for calculating TotalPrice but sending final result. I want it to be updated real time.