ng-options how to set first select always blank

前端 未结 8 2104
耶瑟儿~
耶瑟儿~ 2020-12-05 12:44

I am using angularjs in a project and in which I am using ng-options for generating .

Initially when the pages reload and no option element is selected the html gene

8条回答
  •  伪装坚强ぢ
    2020-12-05 13:30

    I had same problem and after a lot of googling,I understood the main issue was related to my angular version, if you use Angular 1.6.x, just use the ng-value directive and it will work as expected.

    also I set an initial value in my controller, like this :

    $scope.item = 0;
    

提交回复
热议问题