[ad_1]
I’ve created a boolean variable isClearShown: boolean = false;
In my TS component, And i want to toggle the Clear div whenever the input is being written. I have used *ngIf
, and its not working.
This is the code:
The input:
<input type=”search” class=”search-field” #inputSearch placeholder=”Search networks, applications, and more” value=”” name=”s” title=”” />
and the div i want to hide whenever the input is being written:
<div (click)="clearSearch()" [hidden]="isClearShown" *ngIf="isClearShown" class="clear">Clear</div>
[ad_2]