AngularJS ng-options Instruction
AngularJS Examples
Fill a drop-down list with array elements:
<
div
ng-app=
"myApp"
ng-controller=
"myCtrl"
<
select
ng-model=
"selectedName"
ng-options="item for item in names"
<
/select
<
/div
<
scriptvar app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.names = ["Emil", "Tobias", "Linus"];
});
<
/script
Try it »
Definition and Usage
ng-options The directive is used to use
AngularJS Reference Manual