I've been looking a bit around here on similar issues but can't seem to get my issue working. I just want one of the "products" "edit-forms" to pop up when I click "edit." I get why it's opening all of them up, but I'm not sure how to fix it. Possible something in my ng-hide and ng-show?
Thanks for the help.
AdminCtrl.js
$scope.isTrue = false;
$scope.showForm = function() {
if ($scope.isTrue === false) {
$scope.isTrue = true;
}
else $scope.isTrue = false;
}
adminTmpl.html
<div ng-repeat="product in allProducts | filter:search">
<strong>{{ product.name }}</strong> <br />
Description: {{ product.description }} <br />
Price: {{ product.price }} <br />
<div class="edit-form" ng-hide=true ng-show="isTrue">
<input type="text" placeholder="Name" ng-model="update.name" />
<input type="text" placeholder="Description" ng-model="update.description" />
<input type="number" placeholder="Price" ng-model="update.price" />
<button ng-click="edit(product._id, update); showForm()">Update</button>
</div>
<div>
<button ng-click="showForm()">Edit</button>
<button ng-click="delete(product._id)">Delete</button><br /><br />
</div>
</div>