AngularJs and <select>: Default selected options are removed

前端 未结 6 1405
梦如初夏
梦如初夏 2021-02-13 16:05

I expect the following code to render a drop down list with the third option selected by default. However, when I bind the select with angularjs, the default selection disappear

6条回答
  •  故里飘歌
    2021-02-13 16:29

    The easiest way to fix your implementation is to use ng-init.

    Selected Colors: {{selectedColors }}

    Try it on FIDDLE.

提交回复
热议问题