ng-options how to set first select always blank

前端 未结 8 2098
耶瑟儿~
耶瑟儿~ 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:15

    Controller

    $scope.item = '';
    
    $scope.itemlist = {
       '' = '',
       'Item 0' = 1,
       'Item 1' = 2,
       'Item 2' = 3
    };
    

    HTML

    
    

提交回复
热议问题