Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

AngularJS ng-options Directive

AngularJS ng-options Instruction

AngularJS Reference Manual AngularJS Reference Manual


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

<

script

var 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 Fill