I want to display extra information on click of an item in ng-repeat and hide this on mouseleave from this item.
In the code snippet below, when a user clicks on another item, this opens extra information for the first item as well.
Code Snippet
$scope.Click = function (object) {
console.log("Clicked")
this.showDelete = true;
$(".Close").fadeIn(); // <- this did not work actually
}
$(document).mouseup(function (e) {
!$(e.target).closest('.Close').length && $('.Close').fadeOut();
});
<div ng-repeat="item in items">
<div ng-click="Click()">{{item.object}}</div>
<div class="button Close" ng-show="showDelete">delete</div>
</div>
I want to show extra information only for one item at a time.
Please help me to correct my code snippet
$scope.showDeleteinstead ofthis.showDelete.showDeleteis a property from the object, you should use:ng-show="Click(item.object.showDelete)"and in your function:showDelete = true