The if construct in Angular

Condition in Angular can also be done using a special construction @if. This construction allows you to show or hide code blocks by condition. Let's see how to work with it.

Let us have the following variable:

app/app.component.tsexport class AppComponent {
  public isAdmin: boolean = true;
}

Let's make a div that will be shown if this variable has a value of true:

app/app.component.html@if (isAdmin) {
  <div>
    text
  </div>
}

Let's make it so that the div is shown if our variable has a value of false:

app/app.component.html@if (!isAdmin) {
  <div>
    text
  </div>
}
Задание 1

Make the property isAdult. Show the adult text if our variable contains the value true.