I currently have my ng-repeat set up within a div tag:
<div ng-repeat="x in names">
<h1>{{x.product}}</h1>
<h2>{{x.brand}}</h2>
<h3>{{x.description}}</h3>
<h4>{{x.sum}}</h4>
<h5>{{x.productid}}</h5>
</div>
<button ng-click="addToCart()">Add To Cart</button>
Additionally, here's a snippet of my AngularJS script:
$scope.addToCart = function () {
$scope.productId = $scope.x.productid;
$http.post("api/shoppingCart/" + $scope.productId);
}
One issue I'm encountering is my inability to retrieve the value of {{x.productid}} for my $scope.productid variable.