I am encountering an issue with a variable that is holding a textfield value
this.search_value = null;
Next, I have a list made up of cards:
<div *ngFor="let i of lotes" class="card">
<div [hidden]="(this.search_value && this.search_value.trim()) || i.nome_lote.includes(this.search_value) ">
...
</div>
</div
My intention is to hide the cards that do not contain the this.search_value
string within their i.nome_lote
value.
Upon typing in the search field, the search_value
variable is updating correctly.
However, it seems like nothing or everything is being hidden at once... It does not seem to be considering the condition for the string containing.
Could I possibly be making a mistake? Is there a better approach to achieve this?