@@ -5,12 +5,12 @@ import {MatFormFieldModule} from '@angular/material/form-field';
55import { MatSelectModule } from '@angular/material/select' ;
66import { FormControl , FormsModule , ReactiveFormsModule } from '@angular/forms' ;
77
8- /** @title Basic CDK Radio Group */
8+ /** @title Configurable CDK Radio Group */
99@Component ( {
10- selector : 'cdk-radio-example' ,
11- exportAs : 'cdkRadioExample ' ,
12- templateUrl : 'cdk-radio-example.html' ,
13- styleUrl : 'cdk- radio-example .css' ,
10+ selector : 'cdk-radio-configurable- example' ,
11+ exportAs : 'cdkRadioConfigurableExample ' ,
12+ templateUrl : 'cdk-radio-configurable- example.html' ,
13+ styleUrl : '../ radio-common .css' ,
1414 standalone : true ,
1515 imports : [
1616 CdkRadioGroup ,
@@ -22,18 +22,51 @@ import {FormControl, FormsModule, ReactiveFormsModule} from '@angular/forms';
2222 ReactiveFormsModule ,
2323 ] ,
2424} )
25- export class CdkRadioExample {
25+ export class CdkRadioConfigurableExample {
2626 orientation : 'vertical' | 'horizontal' = 'vertical' ;
2727 disabled = new FormControl ( false , { nonNullable : true } ) ;
2828
29- flavors = [ 'Vanilla' , 'Chocolate' , 'Strawberry' , 'Mint Chip' , 'Cookies & Cream' , 'Rocky Road' ] ;
29+ fruits = [
30+ 'Apple' ,
31+ 'Apricot' ,
32+ 'Banana' ,
33+ 'Blackberry' ,
34+ 'Blueberry' ,
35+ 'Cantaloupe' ,
36+ 'Cherry' ,
37+ 'Clementine' ,
38+ 'Cranberry' ,
39+ 'Dates' ,
40+ 'Figs' ,
41+ 'Grapes' ,
42+ 'Grapefruit' ,
43+ 'Guava' ,
44+ 'Kiwi' ,
45+ 'Kumquat' ,
46+ 'Lemon' ,
47+ 'Lime' ,
48+ 'Mandarin' ,
49+ 'Mango' ,
50+ 'Nectarine' ,
51+ 'Orange' ,
52+ 'Papaya' ,
53+ 'Passion' ,
54+ 'Peach' ,
55+ 'Pear' ,
56+ 'Pineapple' ,
57+ 'Plum' ,
58+ 'Pomegranate' ,
59+ 'Raspberries' ,
60+ 'Strawberry' ,
61+ 'Tangerine' ,
62+ 'Watermelon' ,
63+ ] ;
3064
3165 // New controls
3266 readonly = new FormControl ( false , { nonNullable : true } ) ;
3367 skipDisabled = new FormControl ( true , { nonNullable : true } ) ;
3468 focusMode : 'roving' | 'activedescendant' = 'roving' ;
35- selectedValue : string | null = 'Vanilla' ; // To control/reflect the radio group's value
3669
3770 // Control for which radio options are individually disabled
38- disabledOptions : string [ ] = [ 'Chocolate ' ] ;
71+ disabledOptions : string [ ] = [ 'Banana ' ] ;
3972}
0 commit comments