ngIf Example

<div *ngIf="selectedHero">


according to the offical angular website, ngIf and ngFor are “structural directives” because they can change the structure of portions of the DOM. In simple words, they give structure to the way Angular shows content in the DOM