AngularJS – Select

This is HTML select control manipulated by AngularJS. We know that <select> tag has syntax mentioned below:


<option value=”Value of Item”>Text of the Item</option>


We use two AngularJS directives ng-options and ng-repeat to manage <select> tag. Let’s understand it using few examples:


This directive fills the options to select HTML control.





This directive repeats associated HTML element itself to the number of times record is present in data source.




ng-options Vs ng-repeat

Because the ng-repeat directive repeats a block of HTML code for each item in an array, it can be used to create options in a dropdown list, but the ng-options directive was made especially for filling a dropdown list with options, and has at least one important advantage:

Dropdowns made with ng-options allows the selected value to be an object, while dropdowns made from ng-repeat has to be a string.

Be  Connected…

Satyendra Mishra

LinkedIn :
Twitter :
FaceBook :
C# Corner :


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s