我正在测试此代码
<form class="form-horizontal" [formGroup]="editorForm">
<fieldset formGroupName="notification">
<div class="form-group" required>
<label for="emailAdressInput">Email Addresses</label>
<input type="text" id="emailAdressInput" formControlName="emailAdresses">
</div>
<div class="form-group" required>
<label for="phoneNumberInput">Email Addresses</label>
<input type="text" id="phoneNumberInput" formControlName="phoneNumber">
</div>
<div class="form-group" required>
<label for="pagerNumberInput">Email Addresses</label>
<input type="text" id="pagerNumberInput" formControlName="pagerNumber">
</div>
</fieldset>
{{editorForm.get('notification')?.errors| json}}
<br>
<br>
<span *ngIf="editorForm.get('notification')?.errors?.atLeastOneRequired"> {{editorForm.get('notification')?.errors?.atLeastOneRequired.text}}</span>
</form>
但是,当我执行它时,在输出面板中我不能放置任何值,因为代码直接进入第二条指令并以空值崩溃。 在VS for Windows中,直到我输入了vakue,第二条指令才执行 有什么想法吗? 问候