Angular Material md-select default selected value

前端 未结 3 888
北荒
北荒 2021-01-07 17:36

I am using Angular 2 with Angular Material. Looking at the documentation, I am trying to get the select to have a default value as oppose to an empty place holder.

3条回答
  •  被撕碎了的回忆
    2021-01-07 18:43

    According to documentation you can do by the following way.

    Option:1

    
      {{defaultValue}}
      One
      One
      Two
    
    

    Option:2

    
      None
      One
      One
      Two
    
    

    It must any value of select dropdown. Else it will not work.

提交回复
热议问题