是否可以通过按键盘上的 Enter 来触发我的“添加”按钮?
////
这是表单中的最后一个 div,用于第三个间隙:
<div fd-form-item *ngIf="targetType.value != null">
<label fd-form-label for="input-showroom-hostname" [required]="true">URL:</label>
<fd-form-input-message-group>
<input
fd-form-control
type="text"
id="input-showroom-hostname"
placeholder="e.g. l2w.demo.hybris.com"
formControlName="hostname"
[state]="determineFormControlState(hostname)"
/>
<fd-form-message *ngIf="hasRequiredErrors(hostname)" [type]="'error'"> {{ REQUIRED }} </fd-form-message>
<fd-form-message *ngIf="hasShowroomUserRightsErrors(hostname)" [type]="'error'"> {{ SHOWROOM_USER_RIGHTS }}</fd-form-message>
<fd-form-message *ngIf="hasPatternErrors(hostname)" [type]="'error'"> {{ URL_PATTERN }} </fd-form-message>
</fd-form-input-message-group>
</div>
<br />
</div>
Run Code Online (Sandbox Code Playgroud)