<!-- Render (no edit). -->
<ion-item *ngIf="!edit && field && field.name">
    <ion-label>
        <h2>{{ field.name }}</h2>
        <p><core-format-text [text]="value" [contextLevel]="contextLevel" [contextInstanceId]="contextInstanceId"
            [courseId]="courseId">
        </core-format-text></p>
    </ion-label>
</ion-item>

<!-- Edit. -->
<ion-item *ngIf="edit && field && field.shortname && form" class="ion-text-wrap" [formGroup]="form">
    <ion-label position="stacked">
        <span [core-mark-required]="required">{{ field.name }}</span>
    </ion-label>
    <ion-input [type]="inputType" [formControlName]="modelName" [placeholder]="field.name" maxlength="{{maxLength}}"></ion-input>
    <core-input-errors [control]="form.controls[modelName]"></core-input-errors>
</ion-item>
