1

hello I am using the drop down option which are fetch from DB. and i made an array as below

var _arr = new Array()
_arr = [{className:5,avg:40},{className:6,avg:50},{className:7,avg:40}}]

in html inside the select tag

<option ng-repeat="flds in _arr" value="{{flds.className}}"></option>

here expected output will be option tag should have 3 elements. But i got 4 elements

Shardul Pendse
  • 304
  • 1
  • 4
  • 17

1 Answers1

1

Use the ng-options attribute on your <select> tag:

<select ng-options="flds.avg as flds.className for flds in _arr"></select>

More info

Alex
  • 7,639
  • 3
  • 45
  • 58