radio/src/radio-group/radio-group.directive.ts
Wraps and controls a group of <talenra-radio-button>'s.
// Component class
sampleForm: FormGroup = new FormGroup({
userChoice: new FormControl('1'),
});<!-- Component template -->
<form [formGroup]="sampleForm">
<talenra-radio-group formControlName="userChoice">
<talenra-radio-button value="1" label="One" />
<talenra-radio-button value="2" label="Two" />
<talenra-radio-button value="3" label="Three" />
</talenra-radio-group>
</form>// Import `FormsModule` in the declaring module
import { FormsModule } from '@angular/forms';
@NgModule({
// ...
imports: [FormsModule],
})// Component class
userChoice = '2';<!-- Component template -->
<form #templateDrivenForm="ngForm">
<talenra-radio-group name="userChoice" [(ngModel)]="userChoice">
<talenra-radio-button value="1" label="One" />
<talenra-radio-button value="2" label="Two" />
<talenra-radio-button value="3" label="Three" />
</talenra-radio-group>
</form>import { RadioGroupDirective } from '@talenra/components/radio';
| Providers |
)
true
|
| Selector | talenra-radio-group |
Inputs |
Outputs |
Accessors |
| disabled |
Type : boolean
|
|
Determinates whether the control is en-/disabled. |
| value |
Type : any
|
|
The control's value. |
| formControlName |
Type : string
|
Default value : ''
|
|
Name of the corresponding |
| readonly |
Type : boolean, unknown
|
Default value : false, { transform: booleanAttribute }
|
|
Determines whether the control is readonly. |
| valueChange |
Type : RadioGroupChange
|
|
Event emitted when the user changes RadioGroup's value. Example : |
| disabled | ||||||
getdisabled()
|
||||||
|
Determinates whether the control is en-/disabled. |
||||||
setdisabled(value: boolean)
|
||||||
|
Set whether the control is en-/disabled.
Parameters :
Returns :
void
|
| value | ||||||
getvalue()
|
||||||
|
The control's value. |
||||||
setvalue(value: any)
|
||||||
|
Set the control's value.
Parameters :
Returns :
void
|