AngularJS null value for select

后端 未结 9 919
攒了一身酷
攒了一身酷 2021-02-01 14:32

I couldn\'t find an elegant way for setting null values with a

9条回答
  •  梦如初夏
    2021-02-01 14:48

    Try using ng-options instead of manually creating tags, as in this example, lightly-edited from the Angular docs:

    http://plnkr.co/edit/DVXwlFR6MfcfYPNHScO5?p=preview

    The operative parts here are lines 17, defining a 'colors' object, and the ng-options attributes iterating over those colors to create options.

提交回复
热议问题