angularjs - Is it possible to bind an array to dropdown using ngoptions rather than ngrepeat -
i not able bind array dropdown list using ngoptions. neither able understand angularjs documentation same.
<html ng-app=""> <body> <div class="container" ng-init="numbertext=['one', 'two', 'three', 'four', 'four plus']"> <select ng-options="label schedule in numbertext"></select>{{numbertext}}</div> <select> <option ng-repeat="n in numbertext">{{n}}</option> </select> </body> </html> i don't understand documentation trying about
label value in array select label value in array label group group value in array label disable when disable value in array label group group value in array track trackexpr label disable when disable value in array track trackexpr label value in array | orderby:orderexpr track trackexpr (for including filter track by) i seeking explanation of means.
fiddle
you need add ng-model , change label arr element this
<select ng-model="test" ng-options="schedule schedule in numbertext"></select>
Comments
Post a Comment