I'm trying to hide and show the div on click event of icon.for that I am using ngClass with condition.When variable in condition changes the class remains same ,it's not updating the class.

//html 

```
<div class="column  icon">
    <mat-icon (click)="onIconClick()" id="icon" class="column" [ngStyle]="showpanel ? {'color':'#4ac2f7'}:''">filter_list</mat-icon>
</div>

```

//hide and show the div

```
<div class="search-box-container" id="filter-tab" [ngClass]="'showpanel' ? 'show' : 'hidden'">
</div>

```

//onclick icon .ts code

```
onIconClick() {
    if (this.showpanel) {
      this.showpanel = false;
    } else {
      this.showpanel = true;
    }
    console.log(this.showpanel);
}

```