Created
January 7, 2016 17:13
-
-
Save fauverism/f6181975ce92806fe25f to your computer and use it in GitHub Desktop.
Repeat in a select element the angular way
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JS | |
$scope.options = [{ name: "a", id: 1 }, { name: "b", id: 2 }]; | |
$scope.selectedOption = $scope.options[1]; | |
HTML | |
<select data-ng-options="o.name for o in options" data-ng-model="selectedOption"></select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment