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.
LinkedIn : https://www.linkedin.com/in/satyendram
Twitter : https://twitter.com/ersatyendram
FaceBook : http://fb.me/ersatyendram
C# Corner : http://www.c-sharpcorner.com/members/satyendra-mishra4