hide and show in angular 8

JavaScript
<button (click)="toggleShow()" type="checkbox" >show/hide</button>

<div *ngIf="isShown" class="row container-fluid"  id="divshow" >
Div Content

</div>isShown: boolean = false ; // hidden by default


toggleShow() {

this.isShown = ! this.isShown;

}/* Component */
isShown: boolean;

ngOnInit(){
  isShown = false; //hidden every time subscribe detects change
}

toggleShow() {
  this.isShown = ! this.isShown;
}

/* Template */
<div *ngIf="isShown" class="row container-fluid" id="divshow">
  content
</div>
Source

Also in JavaScript: