@@ -20,12 +20,20 @@ const noop = () => { };
20
20
let nextId = 0 ;
21
21
22
22
/**
23
- * **Ignite UI for Angular Radio Group** -
24
- * [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/radio_button.html)
23
+ * Radio group directive renders set of radio buttons.
25
24
*
25
+ * @igxModule IgxRadioModule
26
+ *
27
+ * @igxTheme igx-radio-theme
28
+ *
29
+ * @igxKeywords radiogroup, radio, button, input
30
+ *
31
+ * @igxGroup Data Entry & Display
32
+ *
33
+ * @remarks
26
34
* The Ignite UI Radio Group allows the user to select a single option from an available set of options that are listed side by side.
27
35
*
28
- * Example :
36
+ * @example :
29
37
* ```html
30
38
* <igx-radio-group name="radioGroup">
31
39
* <igx-radio *ngFor="let item of ['Foo', 'Bar', 'Baz']" value="{{item}}">
@@ -42,22 +50,21 @@ let nextId = 0;
42
50
export class IgxRadioGroupDirective implements AfterContentInit , ControlValueAccessor , OnDestroy {
43
51
/**
44
52
* Returns reference to the child radio buttons.
53
+ *
54
+ * @example
45
55
* ```typescript
46
56
* let radioButtons = this.radioGroup.radioButtons;
47
57
* ```
48
- * @memberof IgxRadioGroupDirective
49
58
*/
50
59
@ContentChildren ( IgxRadioComponent , { descendants : true } ) public radioButtons : QueryList < IgxRadioComponent > ;
51
60
52
61
/**
53
62
* Sets/gets the `value` attribute.
63
+ *
64
+ * @example
54
65
* ```html
55
66
* <igx-radio-group [value] = "'radioButtonValue'"></igx-radio-group>
56
67
* ```
57
- * ```typescript
58
- * let value = this.radioGroup.value;
59
- * ```
60
- * @memberof IgxRadioGroupDirective
61
68
*/
62
69
@Input ( )
63
70
get value ( ) : any { return this . _value ; }
@@ -70,13 +77,11 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
70
77
71
78
/**
72
79
* Sets/gets the `name` attribute of the radio group component. All child radio buttons inherits this name.
80
+ *
81
+ * @example
73
82
* ```html
74
83
* <igx-radio-group name = "Radio1"></igx-radio-group>
75
84
* ```
76
- * ```typescript
77
- * let name = this.radioGroup.name;
78
- * ```
79
- * @memberof IgxRadioGroupDirective
80
85
*/
81
86
@Input ( )
82
87
get name ( ) : string { return this . _name ; }
@@ -89,14 +94,14 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
89
94
90
95
/**
91
96
* Sets/gets whether the radio group is required.
97
+ *
98
+ * @remarks
92
99
* If not set, `required` will have value `false`.
100
+ *
101
+ * @example
93
102
* ```html
94
103
* <igx-radio-group [required] = "true"></igx-radio-group>
95
104
* ```
96
- * ```typescript
97
- * let isRequired = this.radioGroup.required;
98
- * ```
99
- * @memberof IgxRadioGroupDirective
100
105
*/
101
106
@Input ( )
102
107
get required ( ) : boolean { return this . _required ; }
@@ -109,10 +114,11 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
109
114
110
115
/**
111
116
* An @Input property that allows you to disable the radio group. By default it's false.
112
- * ```html
117
+ *
118
+ * @example
119
+ * ```html
113
120
* <igx-radio-group [disabled]="true"></igx-radio-group>
114
121
* ```
115
- * @memberof IgxRadioGroupDirective
116
122
*/
117
123
@Input ( )
118
124
get disabled ( ) : boolean { return this . _disabled ; }
@@ -125,14 +131,14 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
125
131
126
132
/**
127
133
* Sets/gets the position of the `label` in the child radio buttons.
134
+ *
135
+ * @remarks
128
136
* If not set, `labelPosition` will have value `"after"`.
137
+ *
138
+ * @example
129
139
* ```html
130
140
* <igx-radio-group labelPosition = "before"></igx-radio-group>
131
141
* ```
132
- * ```typescript
133
- * let labelPosition = this.radioGroup.labelPosition;
134
- * ```
135
- * @memberof IgxRadioGroupDirective
136
142
*/
137
143
@Input ( )
138
144
get labelPosition ( ) : RadioLabelPosition | string { return this . _labelPosition ; }
@@ -145,11 +151,12 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
145
151
146
152
/**
147
153
* Sets/gets the selected child radio button.
154
+ *
155
+ * @example
148
156
* ```typescript
149
157
* let selectedButton = this.radioGroup.selected;
150
158
* this.radioGroup.selected = selectedButton;
151
159
* ```
152
- * @memberof IgxRadioGroupDirective
153
160
*/
154
161
@Input ( )
155
162
get selected ( ) { return this . _selected ; }
@@ -162,52 +169,69 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
162
169
163
170
/**
164
171
* An event that is emitted after the radio group `value` is changed.
172
+ *
173
+ * @remarks
165
174
* Provides references to the selected `IgxRadioComponent` and the `value` property as event arguments.
166
- * @memberof IgxRadioGroupDirective
175
+ *
176
+ * @example
177
+ * ```html
178
+ * <igx-radio-group (change)="handler($event)"></igx-radio-group>
179
+ * ```
167
180
*/
168
181
@Output ( )
169
182
readonly change : EventEmitter < IChangeRadioEventArgs > = new EventEmitter < IChangeRadioEventArgs > ( ) ;
170
183
171
184
/**
172
- *@hidden
185
+ * The css class applied to the component.
186
+ * @hidden
187
+ * @internal
173
188
*/
174
189
@HostBinding ( 'class.igx-radio-group' )
175
190
public cssClass = 'igx-radio-group' ;
176
191
177
192
/**
178
- *@hidden
193
+ * @hidden
194
+ * @internal
179
195
*/
180
196
private _onChangeCallback : ( _ : any ) => void = noop ;
181
197
/**
182
- *@hidden
198
+ * @hidden
199
+ * @internal
183
200
*/
184
201
private _name = `igx-radio-group-${ nextId ++ } ` ;
185
202
/**
186
- *@hidden
203
+ * @hidden
204
+ * @internal
187
205
*/
188
206
private _value : any = null ;
189
207
/**
190
- *@hidden
208
+ * @hidden
209
+ * @internal
191
210
*/
192
211
private _selected : IgxRadioComponent | null = null ;
193
212
/**
194
- *@hidden
213
+ * @hidden
214
+ * @internal
195
215
*/
196
216
private _isInitialized = false ;
197
217
/**
198
- *@hidden
218
+ * @hidden
219
+ * @internal
199
220
*/
200
221
private _labelPosition : RadioLabelPosition | string = 'after' ;
201
222
/**
202
- *@hidden
223
+ * @hidden
224
+ * @internal
203
225
*/
204
226
private _disabled = false ;
205
227
/**
206
- *@hidden
228
+ * @hidden
229
+ * @internal
207
230
*/
208
231
private _required = false ;
209
232
/**
210
- *@hidden
233
+ * @hidden
234
+ * @internal
211
235
*/
212
236
private destroy$ = new Subject < boolean > ( ) ;
213
237
@@ -220,8 +244,13 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
220
244
}
221
245
222
246
/**
247
+ * Sets the "checked" property value on the radio input element.
248
+ *
249
+ * @remarks
223
250
* Checks whether the provided value is consistent to the current radio button.
224
251
* If it is, the checked attribute will have value `true` and selected property will contain the selected `IgxRadioComponent`.
252
+ *
253
+ * @example
225
254
* ```typescript
226
255
* this.radioGroup.writeValue('radioButtonValue');
227
256
* ```
@@ -231,12 +260,18 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
231
260
}
232
261
233
262
/**
234
- *@hidden
263
+ * Registers a function called when the control value changes.
264
+ *
265
+ * @hidden
266
+ * @internal
235
267
*/
236
268
public registerOnChange ( fn : ( _ : any ) => void ) { this . _onChangeCallback = fn ; }
237
269
238
270
/**
239
- *@hidden
271
+ * Registers a function called when the control is touched.
272
+ *
273
+ * @hidden
274
+ * @internal
240
275
*/
241
276
public registerOnTouched ( fn : ( ) => void ) {
242
277
if ( this . radioButtons ) {
@@ -247,15 +282,17 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
247
282
}
248
283
249
284
/**
250
- *@hidden
285
+ * @hidden
286
+ * @internal
251
287
*/
252
288
public ngOnDestroy ( ) : void {
253
289
this . destroy$ . next ( true ) ;
254
290
this . destroy$ . complete ( ) ;
255
291
}
256
292
257
293
/**
258
- *@hidden
294
+ * @hidden
295
+ * @internal
259
296
*/
260
297
private _initRadioButtons ( ) {
261
298
if ( this . radioButtons ) {
@@ -274,7 +311,8 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
274
311
}
275
312
276
313
/**
277
- *@hidden
314
+ * @hidden
315
+ * @internal
278
316
*/
279
317
private _selectedRadioButtonChanged ( args : IChangeRadioEventArgs ) {
280
318
if ( this . _selected !== args . radio ) {
@@ -293,7 +331,8 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
293
331
}
294
332
295
333
/**
296
- *@hidden
334
+ * @hidden
335
+ * @internal
297
336
*/
298
337
private _setRadioButtonNames ( ) {
299
338
if ( this . radioButtons ) {
@@ -304,7 +343,8 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
304
343
}
305
344
306
345
/**
307
- *@hidden
346
+ * @hidden
347
+ * @internal
308
348
*/
309
349
private _selectRadioButton ( ) {
310
350
if ( this . radioButtons ) {
@@ -336,7 +376,8 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
336
376
}
337
377
338
378
/**
339
- *@hidden
379
+ * @hidden
380
+ * @internal
340
381
*/
341
382
private _setRadioButtonLabelPosition ( ) {
342
383
if ( this . radioButtons ) {
@@ -347,7 +388,8 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
347
388
}
348
389
349
390
/**
350
- *@hidden
391
+ * @hidden
392
+ * @internal
351
393
*/
352
394
private _disableRadioButtons ( ) {
353
395
if ( this . radioButtons ) {
@@ -358,7 +400,8 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
358
400
}
359
401
360
402
/**
361
- *@hidden
403
+ * @hidden
404
+ * @internal
362
405
*/
363
406
private _setRadioButtonsRequired ( ) {
364
407
if ( this . radioButtons ) {
0 commit comments