@@ -3,7 +3,7 @@ import {FormControl, FormsModule, NgModel, ReactiveFormsModule} from '@angular/f
3
3
import { Component , DebugElement , ViewChild } from '@angular/core' ;
4
4
import { CommonModule } from '@angular/common' ;
5
5
import { By } from '@angular/platform-browser' ;
6
- import { dispatchFakeEvent } from '../.. /cdk/testing/private' ;
6
+ import { dispatchFakeEvent } from '@angular /cdk/testing/private' ;
7
7
import {
8
8
MAT_RADIO_DEFAULT_OPTIONS ,
9
9
MatRadioButton ,
@@ -15,8 +15,11 @@ import {
15
15
describe ( 'MDC-based MatRadio' , ( ) => {
16
16
beforeEach ( waitForAsync ( ( ) => {
17
17
TestBed . configureTestingModule ( {
18
- imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
19
- declarations : [
18
+ imports : [
19
+ MatRadioModule ,
20
+ FormsModule ,
21
+ ReactiveFormsModule ,
22
+ CommonModule ,
20
23
DisableableRadioButton ,
21
24
FocusableRadioButton ,
22
25
RadiosInsideRadioGroup ,
@@ -965,8 +968,7 @@ describe('MatRadioDefaultOverrides', () => {
965
968
describe ( 'when MAT_RADIO_DEFAULT_OPTIONS overridden' , ( ) => {
966
969
beforeEach ( waitForAsync ( ( ) => {
967
970
TestBed . configureTestingModule ( {
968
- imports : [ MatRadioModule , FormsModule ] ,
969
- declarations : [ DefaultRadioButton , RadioButtonWithColorBinding ] ,
971
+ imports : [ MatRadioModule , FormsModule , DefaultRadioButton , RadioButtonWithColorBinding ] ,
970
972
providers : [
971
973
{
972
974
provide : MAT_RADIO_DEFAULT_OPTIONS ,
@@ -1021,6 +1023,8 @@ describe('MatRadioDefaultOverrides', () => {
1021
1023
</mat-radio-button>
1022
1024
</mat-radio-group>
1023
1025
` ,
1026
+ standalone : true ,
1027
+ imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
1024
1028
} )
1025
1029
class RadiosInsideRadioGroup {
1026
1030
labelPos : 'before' | 'after' ;
@@ -1041,6 +1045,8 @@ class RadiosInsideRadioGroup {
1041
1045
<mat-radio-button value="leaf" checked>Bulbasaur</mat-radio-button>
1042
1046
</mat-radio-group>
1043
1047
` ,
1048
+ standalone : true ,
1049
+ imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
1044
1050
} )
1045
1051
class RadiosInsidePreCheckedRadioGroup { }
1046
1052
@@ -1065,6 +1071,8 @@ class RadiosInsidePreCheckedRadioGroup {}
1065
1071
<mat-radio-button name="fruit" value="raspberry">Raspberry</mat-radio-button>
1066
1072
<mat-radio-button id="nameless" value="no-name">No name</mat-radio-button>
1067
1073
` ,
1074
+ standalone : true ,
1075
+ imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
1068
1076
} )
1069
1077
class StandaloneRadioButtons {
1070
1078
ariaLabel : string = 'Banana' ;
@@ -1080,6 +1088,8 @@ class StandaloneRadioButtons {
1080
1088
}
1081
1089
</mat-radio-group>
1082
1090
` ,
1091
+ standalone : true ,
1092
+ imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
1083
1093
} )
1084
1094
class RadioGroupWithNgModel {
1085
1095
modelValue : string ;
@@ -1094,6 +1104,8 @@ class RadioGroupWithNgModel {
1094
1104
1095
1105
@Component ( {
1096
1106
template : `<mat-radio-button>One</mat-radio-button>` ,
1107
+ standalone : true ,
1108
+ imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
1097
1109
} )
1098
1110
class DisableableRadioButton {
1099
1111
@ViewChild ( MatRadioButton ) matRadioButton : MatRadioButton ;
@@ -1110,6 +1122,8 @@ class DisableableRadioButton {
1110
1122
<mat-radio-button value="2">Two</mat-radio-button>
1111
1123
</mat-radio-group>
1112
1124
` ,
1125
+ standalone : true ,
1126
+ imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
1113
1127
} )
1114
1128
class RadioGroupWithFormControl {
1115
1129
@ViewChild ( MatRadioGroup ) group : MatRadioGroup ;
@@ -1118,6 +1132,8 @@ class RadioGroupWithFormControl {
1118
1132
1119
1133
@Component ( {
1120
1134
template : `<mat-radio-button [disabled]="disabled" [tabIndex]="tabIndex"></mat-radio-button>` ,
1135
+ standalone : true ,
1136
+ imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
1121
1137
} )
1122
1138
class FocusableRadioButton {
1123
1139
tabIndex : number ;
@@ -1134,6 +1150,8 @@ class FocusableRadioButton {
1134
1150
}
1135
1151
</mat-radio-group>
1136
1152
` ,
1153
+ standalone : true ,
1154
+ imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
1137
1155
} )
1138
1156
class InterleavedRadioGroup {
1139
1157
modelValue = 'strawberry' ;
@@ -1149,21 +1167,29 @@ class InterleavedRadioGroup {
1149
1167
template : `
1150
1168
<div><ng-content></ng-content></div>
1151
1169
` ,
1170
+ standalone : true ,
1171
+ imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
1152
1172
} )
1153
1173
class TranscludingWrapper { }
1154
1174
1155
1175
@Component ( {
1156
1176
template : `<mat-radio-button tabindex="5"></mat-radio-button>` ,
1177
+ standalone : true ,
1178
+ imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
1157
1179
} )
1158
1180
class RadioButtonWithPredefinedTabindex { }
1159
1181
1160
1182
@Component ( {
1161
1183
template : `<mat-radio-button></mat-radio-button>` ,
1184
+ standalone : true ,
1185
+ imports : [ MatRadioModule , FormsModule ] ,
1162
1186
} )
1163
1187
class DefaultRadioButton { }
1164
1188
1165
1189
@Component ( {
1166
1190
template : `<mat-radio-button color="warn"></mat-radio-button>` ,
1191
+ standalone : true ,
1192
+ imports : [ MatRadioModule , FormsModule ] ,
1167
1193
} )
1168
1194
class RadioButtonWithColorBinding { }
1169
1195
@@ -1173,6 +1199,8 @@ class RadioButtonWithColorBinding {}
1173
1199
aria-label="Radio button"
1174
1200
aria-describedby="something"
1175
1201
aria-labelledby="something-else"></mat-radio-button>` ,
1202
+ standalone : true ,
1203
+ imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
1176
1204
} )
1177
1205
class RadioButtonWithPredefinedAriaAttributes { }
1178
1206
@@ -1192,6 +1220,8 @@ class RadioButtonWithPredefinedAriaAttributes {}
1192
1220
}
1193
1221
</mat-radio-group>
1194
1222
` ,
1223
+ standalone : true ,
1224
+ imports : [ MatRadioModule , FormsModule , ReactiveFormsModule , CommonModule ] ,
1195
1225
} )
1196
1226
class PreselectedRadioWithStaticValueAndNgIf {
1197
1227
@ViewChild ( 'preselectedGroup' , { read : MatRadioGroup } ) preselectedGroup : MatRadioGroup ;
0 commit comments