|
| 1 | +import {Component} from '@angular/core'; |
| 2 | + |
| 3 | + |
| 4 | +@Component({ |
| 5 | + moduleId: module.id, |
| 6 | + selector: 'select-a11y', |
| 7 | + templateUrl: 'select-a11y.html', |
| 8 | + styleUrls: ['select-a11y.css'], |
| 9 | +}) |
| 10 | +export class SelectAccessibilityDemo { |
| 11 | + selectedColor: string; |
| 12 | + selectedTopping: string[]; |
| 13 | + selectedPokemon: string; |
| 14 | + |
| 15 | + colors = [ |
| 16 | + {value: 'red', label: 'Red'}, |
| 17 | + {value: 'green', label: 'Green'}, |
| 18 | + {value: 'blue', label: 'Blue'}, |
| 19 | + {value: 'cyan', label: 'Cyan'}, |
| 20 | + {value: 'magenta', label: 'Magenta'}, |
| 21 | + {value: 'yellow', label: 'Yellow'}, |
| 22 | + {value: 'black', label: 'Black'}, |
| 23 | + ]; |
| 24 | + |
| 25 | + toppings = [ |
| 26 | + {value: 'pepperoni', label: 'Pepperoni'}, |
| 27 | + {value: 'mushrooms', label: 'Mushrooms'}, |
| 28 | + {value: 'onions', label: 'Onions'}, |
| 29 | + {value: 'sausage', label: 'Sausage'}, |
| 30 | + {value: 'bacon', label: 'Bacon'}, |
| 31 | + {value: 'cheese', label: 'Cheese'}, |
| 32 | + {value: 'olives', label: 'Olives'}, |
| 33 | + {value: 'peppers', label: 'Peppers'}, |
| 34 | + {value: 'pineapple', label: 'Pineapple'}, |
| 35 | + {value: 'spinach', label: 'Spinach'}, |
| 36 | + ]; |
| 37 | + |
| 38 | + pokemon = [ |
| 39 | + { |
| 40 | + label: 'Grass', |
| 41 | + pokemon: [ |
| 42 | + {value: 'bulbasaur', label: 'Bulbasaur'}, |
| 43 | + {value: 'oddish', label: 'Oddish'}, |
| 44 | + {value: 'bellsprout', label: 'Bellsprout'} |
| 45 | + ] |
| 46 | + }, |
| 47 | + { |
| 48 | + label: 'Water', |
| 49 | + pokemon: [ |
| 50 | + {value: 'squirtle', label: 'Squirtle'}, |
| 51 | + {value: 'psyduck', label: 'Psyduck'}, |
| 52 | + {value: 'horsea', label: 'Horsea'} |
| 53 | + ] |
| 54 | + }, |
| 55 | + { |
| 56 | + label: 'Fire', |
| 57 | + disabled: true, |
| 58 | + pokemon: [ |
| 59 | + {value: 'charmander', label: 'Charmander'}, |
| 60 | + {value: 'vulpix', label: 'Vulpix'}, |
| 61 | + {value: 'flareon', label: 'Flareon'} |
| 62 | + ] |
| 63 | + }, |
| 64 | + { |
| 65 | + label: 'Psychic', |
| 66 | + pokemon: [ |
| 67 | + {value: 'mew', label: 'Mew'}, |
| 68 | + {value: 'mewtwo', label: 'Mewtwo'} |
| 69 | + ] |
| 70 | + } |
| 71 | + ]; |
| 72 | +} |
0 commit comments