Set default option in mat-select

后端 未结 11 1728
北恋
北恋 2020-11-30 08:31

I have a simple select option form field in my Angular material project:

component.html

  
    

        
11条回答
  •  囚心锁ツ
    2020-11-30 09:00

    On your typescript file, just assign this domain on modeSelect on Your ngOnInit() method like below:
    
    
    
     ngOnInit() {
            this.modeSelect = "domain";
          }
    

    And on your html, use your select list.

    
            
              Domain
              Exact
            
          
    

提交回复
热议问题