Today I Learned

hashrocket A Hashrocket project

Select tag options in #angular 1

To display options for a select tag in Angular 1 use the ngOptions attribute and a comprehension expression.

 <select ng-model="myColor" ng-options="color for color in ['red']">
 </select>

The comprehension expression is like a query for your data maybe? Weird stuff.

The ng-model is necessary for the options to display.

See More #javascript TILs
Looking for help? At Hashrocket, our JavaScript experts launch scalable, performant apps on the Web, Android and iOS. Contact us and find out how we can help you.