Skip to content

Instantly share code, notes, and snippets.

@callblueday
Last active December 20, 2015 21:39
Show Gist options
  • Save callblueday/6199167 to your computer and use it in GitHub Desktop.
Save callblueday/6199167 to your computer and use it in GitHub Desktop.
angularjs select.you might as well define the array in your controller
<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;
}
@callblueday
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment