if else condition in html code code example
Example 1: IF else statement
var age=20;
if (age < 18) {
console.log("underage");
} else {
console.log("let em in!");
}
Example 2: html if else statement example
<div *ngIf="!show">
<div>show is false</div>
</div>
<div *ngIf="show">
<div>show is ture</div>
</div>
Example 3: IF else statement
var age=20;
if (age < 18) {
console.log("underage");
} else {
console.log("let em in!");
}