Javatpoint Logo
Javatpoint Logo

AngularJS ng-options Directive

The AngularJS ng-options directive is used to dynamically generate a list of <option> elements for the <select> elements. It uses array to fill the dropdown list. The ng-repeat directive can also be used in some cases for the same reason and it is easier too, but ng-options directive provides more flexibility.

It is supported by <select> statement.

Syntax:

array expression: It specifies an expression that selects the specified parts of an array to fill the select element.

Let's take an example to demonstrate the usage of ng-options directive.

See this example:

Test it Now




Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA