There is a search box containing an ng-model:
<input type="text" class="form-control" placeholder="Search" ng-model="searchLibrary.text">
Additionally, there is an ng-repeat utilizing a filter searchLibrary.text
<div ng-repeat="w in items | filter:searchLibrary.text" on-item-removed="onItemRemoved(item)">
Is it possible to hide non-matching elements instead of removing them when the user inputs text into the search box?
The issue with removing elements is that the callback method assigned to the ng-repeat
gets triggered even when a user simply searches for an item.
Edit: All items in the items
array are draggable, allowing users to manually move them from panel A to panel B. The callback should only be triggered when an item is actually removed, not when the user performs a search.
Any assistance would be greatly appreciated.