Syntactic Sugar in Angular Terms

The *ngIf directive is actually syntactic sugar (i.e. a simplification of the syntax for convenience). Let's see what this means. Let's say we have the following code:

app/app.component.html<div *ngIf="isAdmin">
  text
</div>

In fact, technically it will look like this:

app/app.component.html<ng-template [ngIf]="isAdmin">
  <div>
    text
  </div>
</ng-template>
Задание 1

Let the property age store the user's age. Show adult text if the user's age is greater than 18 years old, and child text otherwise.