Is there a way to dynamically calculate the total price of a product using AngularJS when the quantity is added? Here is the code I currently have:
<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>
In my controller, I have this logic:
$scope.TotalPrice = $scope.Price * $scope.Quantity;
I understand that Angular doesn't support hidden inputs, so I'm seeking advice on the best practices to handle this situation. Additionally, the button is meant for submitting the final result rather than calculating the total price. How can I ensure that the total price updates in real-time?