<!-- featured items table -->
<ul>
<li ng-repeat="item in items track by item.id">
<a href="" ng-click="addCart(item.id)">{{item.status}}</a>
</li>
</ul>
<!-- another tabs from same data table -->
<ul>
<li ng-repeat="item in items track by item.id">
<a href="" ng-click="addCart(item.id)">{{item.status}}</a>
</li>
</ul>
<script>
// controler
//items array here
// controller end
// start add to cart controller
$scope.addCart = function(id){
$scope.items[id].status = 'added';
}
//end of add to cart controller
</script>
i am new in angular js my code is look like as i wrote above i want to make a function addtocart
just once and when i click this function i want replace the whole page row where item.id
match whataever if id
else where inside ng-repeat
whatever if id match both ng-repeat
. when i try to do that i got error about access array and sometime work only for 1 row.
any idea suggestion what i need to do ?
thankyou
regards, Ahsan Haroon