14
rated 0 times
[
16]
[
2]
/ answers: 1 / hits: 69341
/ 9 Years ago, tue, may 12, 2015, 12:00:00
I want that on click of Add to Cart button, item will add on My Cart. Here is my angularJS code
app.controller(OnlineShopping, function($scope)
{
$scope.items = [
{Product:Moto G2, Desc: Android Phone, Price: 10999},
{Product:The Monk who sold his ferrari, Desc: Motivational book, Price: 250},
{Product:Mi Power Bank, Desc: Power Bank, Price: 999},
{Product:Dell Inspiron 3537, Desc: Laptop, Price: 45600}
];
$scope.editing = false;
$scope.addItem = function(item) {
$scope.items.push(item);
$scope.item = {};
};
I found some questions here with using ng-model
and ng-bing
but it works with textbox, but here I am not taking input from the textbox. Here is my incomplete code for My Cart
<h2>My Cart</h2>
<div style=border: 1px solid blue;>
</div>
<table border=1 class=mytable>
<tr>
<td>Item</td>
<td>Description</td>
<td>Price</td>
</tr>
<tr ng-repeat=item in items>
<!-- What should be here -->
</tr>
</table>
More From » jquery