Check out example codes for "angular show element in component". It will help you in understanding the concepts better.

Code Example 1

isShown: boolean = false ; // hidden by default


toggleShow() {

this.isShown = ! this.isShown;

}

Code Example 2

isShown: boolean;

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

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

Code Example 3

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

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

</div>

Learn ReactJs, React Native from akashmittal.com