![](/img/trans.png)
[英]Angular Material Input and select inside one form field in single row
[英]angular material select and input inside the same field
我遇到了这篇文章,当 select 在输入之后时效果很好,但是如何在 matinput 之前将它与 mat-select 一起使用? 一旦我切换顺序,组件就会变得不可用,每次在该字段内单击都会触发 select。
我的叉子: https://stackblitz.com/edit/angular-6nqzf1-ox413y?file=app%2Fform-field-overview-example.html
<mat-form-field appearance="outline">
<mat-label>End Time</mat-label>
<mat-select name="ampm" class="ampm" [(ngModel)]="event.eampm">
<mat-option value="AM">AM</mat-option>
<mat-option value="PM">PM</mat-option>
</mat-select>
<input matInput type="time" placeholder="HH:MM" id="end_time_hour" [formControl]="timeFormControl">
</mat-form-field>
遵循 angular-material 文档,该文档着眼于创建自定义表单域控件:创建自定义表单域控件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.