How to set a preselected option as default in a select field using AngularJS

后端 未结 2 616
死守一世寂寞
死守一世寂寞 2021-01-28 19:16

I am having troubles with setting the default value of a select box in HTML using AngularJS.

Here\'s my scope variable in the controller:

$scope.sensorRe         


        
2条回答
  •  梦谈多话
    2021-01-28 19:39

    Have you tried using ng-options instead of creating separate option elements?

    
                            
        
    提交评论

提交回复
热议问题