VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/angularjs-ng-options-directive/

⇱ AngularJS ng-options Directive - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

AngularJS ng-options Directive

Last Updated : 11 Jul, 2025

The ng-options Directive in AngularJS is used to build and bind HTML elements with options to a model property. It is used to specify <options> in a <select> list. It is designed specifically to populate the items on a dropdown list. This directive implements an array, in order to fill the dropdown list. It is supported by the <select> element.

Syntax:

<element ng-options="expression"> 
 Content ... 
</element>

Parameter value:

  • expression: It selects the particular portion of an array to fill the selected element.

Example 1: This example implements the ng-options Directive to display the option element in AngularJS.

Output:

👁 Image
 

Example 2: This example implements the ng-options Directive to hide or display the element in AngularJS.

Output:

👁 Image
 
Comment

Explore