Thursday, February 26, 2015

angularJs bind a simple array or list to select

To bind an array or list of a single field (such as array of strings) to a select control in angularJS, the following code can be used.
<select id="Country" name="Country" ng-model="Data.Country" ng-options="o as o for o in Data.Countries">
Data.Country can be the model data is assigned to and Data.Countries is the array object or list of countries.

No comments:

Post a Comment