Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. <select ng-model="color" ng-options="(c.name+' '+c.shade) for c in colors"></select>
  2.  
  3. function MyCntrl($scope) {
  4. $scope.colors = [
  5. {name:'black', shade:'dark'},
  6. {name:'white', shade:'light'},
  7. {name:'red', shade:'dark'},
  8. {name:'blue', shade:'dark'},
  9. {name:'yellow', shade:'light'}
  10. ];
  11. $scope.color = $scope.colors[2]; // red
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement