How do I set the value property in AngularJS' ng-options?

后端 未结 27 1189
感动是毒
感动是毒 2020-11-22 08:17

Here is what seems to be bothering a lot of people (including me).

When using the ng-options directive in AngularJS to fill in the options for a &

27条回答
  •  轮回少年
    2020-11-22 09:10

    The ng-options directive does not set the value attribute on the elements for arrays:

    Using limit.value as limit.text for limit in limits means:

    set the 's label as limit.text
    save the limit.value value into the select's ng-model

    See Stack Overflow question AngularJS ng-options not rendering values.

提交回复
热议问题