如果源列表为空,我想禁用 mat-form-field
和/或 mat-autocomplete。我已经在 mat-form-field
上尝试了 disable="true"
(disable=list.empty) 但没有用。
这里是 stackblitz:https://stackblitz.com/angular/dnbdkokmnelo?file=app%2Fchips-autocomplete-example.html
如果水果列表是空的怎么办?
我正在寻找类似 disabled mat-select
...
https://stackblitz.com/angular/rkdgkaerxdk?file=app%2Fselect-disabled-example.ts
最佳答案
如果您想禁用 MatChipList,只需在 mat-chip-list
标签中写入 [disabled]="true"。现在用户不能再移除筹码了。
如果要禁用输入字段,只需在input
标签中写入[disabled]="true"即可。
当然你可以使用任何条件而不是true
关于angular - 如果列表为空,如何禁用 mat-form-field 或 mat-autocomplete?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58325820/