How to export or get LOCAL variables of a *ngFor loop OUTSIDE it in Angular (v9, Material)
问题 First steps in Angular (with Material at version 9). I'm creating a form with the following code: HTML: <mat-form-field> <mat-label>Course</mat-label> <mat-select [formControl]="subjectControl" [attr.data-tag-subjectSemester]="this.subjectControl.value ? this.subjectControl.value.trim() : '' [attr.data-tag-subjectName]="this.subjectControl.value ? this.subjectControl.value.trim() : '' (selectionChange)="onChange($event)" required > <mat-option>-- None --</mat-option> <mat-optgroup *ngFor="let