Class IgxRadioGroupDirective

Ignite UI for Angular Radio Group - Documentation

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.

Example:

<igx-radio-group name="radioGroup">
  <igx-radio *ngFor="let item of ['Foo', 'Bar', 'Baz']" value="{{item}}">
     {{item}}
  </igx-radio>
</igx-radio-group>

Hierarchy

  • IgxRadioGroupDirective

Implements

  • AfterContentInit
  • ControlValueAccessor
  • OnDestroy

Properties

change

change: EventEmitter<IChangeRadioEventArgs> = new EventEmitter<IChangeRadioEventArgs>()

An event that is emitted after the radio group value is changed. Provides references to the selected IgxRadioComponent and the value property as event arguments.

memberof

IgxRadioGroupDirective

radioButtons

radioButtons: QueryList<IgxRadioComponent>

Returns reference to the child radio buttons.

let radioButtons =  this.radioGroup.radioButtons;
memberof

IgxRadioGroupDirective

Accessors

disabled

  • get disabled(): boolean
  • set disabled(newValue: boolean): void
  • An @Input property that allows you to disable the radio group. By default it's false.

    <igx-radio-group [disabled]="true"></igx-radio-group>
    memberof

    IgxRadioGroupDirective

    Returns boolean

  • An @Input property that allows you to disable the radio group. By default it's false.

    <igx-radio-group [disabled]="true"></igx-radio-group>

    Parameters

    • newValue: boolean

    Returns void

labelPosition

  • Sets/gets the position of the label in the child radio buttons. If not set, labelPosition will have value "after".

    <igx-radio-group labelPosition = "before"></igx-radio-group>
    let labelPosition =  this.radioGroup.labelPosition;
    memberof

    IgxRadioGroupDirective

    Returns RadioLabelPosition | string

  • Sets/gets the position of the label in the child radio buttons. If not set, labelPosition will have value "after".

    <igx-radio-group labelPosition = "before"></igx-radio-group>
    let labelPosition =  this.radioGroup.labelPosition;

    Parameters

    Returns void

name

  • get name(): string
  • set name(newValue: string): void
  • Sets/gets the name attribute of the radio group component. All child radio buttons inherits this name.

    <igx-radio-group name = "Radio1"></igx-radio-group>
    let name =  this.radioGroup.name;
    memberof

    IgxRadioGroupDirective

    Returns string

  • Sets/gets the name attribute of the radio group component. All child radio buttons inherits this name.

    <igx-radio-group name = "Radio1"></igx-radio-group>
    let name =  this.radioGroup.name;

    Parameters

    • newValue: string

    Returns void

required

  • get required(): boolean
  • set required(newValue: boolean): void
  • Sets/gets whether the radio group is required. If not set, required will have value false.

    <igx-radio-group [required] = "true"></igx-radio-group>
    let isRequired =  this.radioGroup.required;
    memberof

    IgxRadioGroupDirective

    Returns boolean

  • Sets/gets whether the radio group is required. If not set, required will have value false.

    <igx-radio-group [required] = "true"></igx-radio-group>
    let isRequired =  this.radioGroup.required;

    Parameters

    • newValue: boolean

    Returns void

selected

value

  • get value(): any
  • set value(newValue: any): void

Methods

ngAfterContentInit

  • ngAfterContentInit(): void

writeValue

  • writeValue(value: any): void
  • Checks whether the provided value is consistent to the current radio button. If it is, the checked attribute will have value true and selected property will contain the selected IgxRadioComponent.

    this.radioGroup.writeValue('radioButtonValue');

    Parameters

    • value: any

    Returns void