1
votes

I want to disable mat-form-field and/or mat-autocomplete if source list is empty. I've tried disable="true" (disable=list.empty) on mat-form-field and doesnt work.

Here's stackblitz: https://stackblitz.com/angular/dnbdkokmnelo?file=app%2Fchips-autocomplete-example.html

What if the fruits list was empty?

I'm looking for something like disabled mat-select...

https://stackblitz.com/angular/rkdgkaerxdk?file=app%2Fselect-disabled-example.ts

1

1 Answers

2
votes

If you want to disable MatChipList just write [disabled]="true" in mat-chip-list tag. But user can not remove chips anymore.

If you want to disable input field just write [disabled]="true" in input tag.

Ofcourse you can user any condition instead of true