Last active
December 20, 2015 21:39
-
-
Save callblueday/6199167 to your computer and use it in GitHub Desktop.
angularjs select.you might as well define the array in your controller
This file contains 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
<div ng-app> | |
<h2>Todo</h2> | |
<div ng-controller="QuarterController"> | |
<select name="quarter" ng-model="Quarter" | |
ng-options="obj.value as obj.text for obj in [ | |
{'value': 1,'text' : 'Q1'},{'value':2,'text':'Q2'},{'value':3,'text':'Q3'},{'value':4,'text':'Q4'}]"> | |
</select> | |
</div> | |
</div> | |
function QuarterController($scope) { | |
$scope.Quarter = 2; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://docs.angularjs.org/api/ng.directive:select