Have another question about Angular:
I'm trying to create a functionality where the value entered in the #quantity input is multiplied by the item's price stored in the controller.
For instance, if the price is 99.00 and the user enters a quantity of 2, the result of 99 * 2 should be displayed in the .total div.
How can I achieve this?
Here is the relevant HTML code snippet:
<input type="number" min="0" max="10" id="quantity" name="store-quantity" value='1'/>
<div class="total">
<!-- Total will be displayed here -->
</div>
A glimpse of my store.controller.js file:
angular.module('angularStoreApp')
.controller('StoreCtrl', function ($scope, $http) {
var item = [
{
name: 'Almond Toe Court Shoes, Patent Black',
price: 99.00,
category: 'Womens Footware',
stock: 5,
canPurchase: true,
images: [
"assets/images/yeoman.png",
"http://billypurvis.co.uk/wp-content/uploads/2015/06/ACTA.png"
]
},