Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select ng-model="color" ng-options="(c.name+' '+c.shade) for c in colors"></select>
- function MyCntrl($scope) {
- $scope.colors = [
- {name:'black', shade:'dark'},
- {name:'white', shade:'light'},
- {name:'red', shade:'dark'},
- {name:'blue', shade:'dark'},
- {name:'yellow', shade:'light'}
- ];
- $scope.color = $scope.colors[2]; // red
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement