How to make a 'mat-select' readonly?

前端 未结 2 2076
悲哀的现实
悲哀的现实 2021-02-13 03:00

I am working on a angular 5 project. There are many mat-select elements which is supposed to be readonly like text boxes. I found out that there is a disabled

2条回答
  •  伪装坚强ぢ
    2021-02-13 03:24

    You can combine an editable select with a readonly textbox and ngIf between them:

      
        Choose an option
        
        
          Option 1
          Option 2 (disabled)
          Option 3
        
      
    

提交回复
热议问题