|
1 |
| -# select |
2 |
| -## md-select |
| 1 | +select |
| 2 | +====== |
| 3 | + |
| 4 | +md-select |
| 5 | +--------- |
3 | 6 |
|
4 | 7 | ### Example
|
5 | 8 |
|
6 | 9 | ```javascript
|
7 | 10 | {
|
8 |
| - "type": "select", |
9 |
| - "key": "name", |
10 |
| - "templateOptions": { |
11 |
| - "label": "Name", |
12 |
| - "theme": "custom", |
13 |
| - "multiple": true, |
14 |
| - "labelProp": "firstName", |
15 |
| - "valueProp": "id", |
16 |
| - "options": [ |
17 |
| - {"firstName": "Sarah", id: 1}, |
18 |
| - {"firstName": "Jessica", id: 2}, |
19 |
| - {"firstName": "Parker", id: 3} |
20 |
| - ] |
| 11 | + type: "select", |
| 12 | + key: "name", |
| 13 | + templateOptions: { |
| 14 | + label: "Name", |
| 15 | + theme: "custom", |
| 16 | + multiple: true, |
| 17 | + labelProp: "firstName", |
| 18 | + valueProp: "id", |
| 19 | + options: [ |
| 20 | + {firstName: "Sarah", id: 1}, |
| 21 | + {firstName: "Jessica", id: 2}, |
| 22 | + {firstName: "Parker", id: 3} |
| 23 | + ], |
| 24 | + onOpen: () => { |
| 25 | + console.log('select is opened'); |
| 26 | + }, |
| 27 | + onClose: () => { |
| 28 | + console.log('select is closed'); |
| 29 | + } |
21 | 30 | }
|
22 | 31 | }
|
23 | 32 | ```
|
24 | 33 |
|
25 | 34 | ### Configuration
|
26 | 35 |
|
27 |
| -#### templateOptions.label _: string_ |
| 36 | +#### templateOptions.label *: string* |
| 37 | + |
| 38 | +#### templateOptions.theme *: string* |
28 | 39 |
|
29 |
| -#### templateOptions.theme _: string_ |
| 40 | +#### templateOptions.options *: array* |
30 | 41 |
|
31 |
| -#### templateOptions.options _: array_ |
32 | 42 | Array with available options
|
33 | 43 |
|
34 |
| -#### templateOptions.labelProp _: string (default: name)_ |
| 44 | +#### templateOptions.labelProp *: string (default: name)* |
| 45 | + |
35 | 46 | Name of property with option's label
|
36 | 47 |
|
37 |
| -#### templateOptions.valueProp _: string_ |
| 48 | +#### templateOptions.valueProp *: string* |
| 49 | + |
38 | 50 | Name of property with option's value
|
39 | 51 |
|
40 |
| -#### templateOptions.multiple _: boolean_ |
| 52 | +#### templateOptions.multiple *: boolean* |
| 53 | + |
41 | 54 | Multiple choice
|
| 55 | + |
| 56 | +#### templateOptions.onOpen *: function* |
| 57 | + |
| 58 | +Bound to md-on-open. |
| 59 | + |
| 60 | +Expression to be evaluated when the select is opened. |
| 61 | + |
| 62 | +If expression returns a promise, it will display a loading indicator while it is being resolved. |
| 63 | + |
| 64 | +#### templateOptions.onClose *: function* |
| 65 | + |
| 66 | +Bound to md-on-close. |
| 67 | + |
| 68 | +Expression to be evaluated when the select is closed. |
0 commit comments