MaterialRadioComponent class

A radio button with material style. Usually used together with material-radio-group. Once checked, same radio button can not be unchecked via user action.

Keyboard interaction for focus is a little unusual, so we are managing our own streams instead of using FocusItemDirective.

Attributes:

  • no-ink -- set this attribute to disable the ripple effect on the chip.
Inheritance
Implemented types
Annotations
  • @Component(selector: 'material-radio', directives: [MaterialIconComponent, MaterialRippleComponent, NgIf], providers: [ExistingProvider(HasDisabled, MaterialRadioComponent)], templateUrl: 'material_radio.html', styleUrls: ['material_radio.scss.css'], changeDetection: ChangeDetectionStrategy.onPush)

Constructors

MaterialRadioComponent(HtmlElement _root, ChangeDetectorRef _changeDetector, @Host() @Optional() MaterialRadioGroupComponent? _group, @Self() @Optional() NgControl? cd, @Attribute('role') String? role)

Properties

checked bool
Whether the radio should be preselected.
getter/setter pair
checkedStr String
no setter
disabled bool
Whether the radio should not respond to events, and have a style that suggests that interaction is not allowed.
getter/setter pairoverride
disabledStr String
no setter
focusDelegate Future
no setter
focusmove Stream<FocusMoveEvent>
The item publishes to this stream in order to move focus to another item.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
icon Icon
Current icon, depends on the state of checked.
no setter
onChecked Stream<bool>
Published when the radio selection state changes.
no setter
radioGroupName String?
getter/setter pair
role String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectionmove Stream<FocusMoveEvent>
no setter
showFocus bool
Whether focus should be drawn.
no setter
tabbable bool
Moves focus item into (tabIndex='0') or out of (tabIndex='-1') tab order.
no getteroverride
tabIndex int
no setter
tabIndexStr String
Current tab index, depends on state of disabled and selection status if in group.
no setter
value ↔ dynamic
Value this radio represents, used in selection model with radio-group.
getter/setter pair

Methods

dispose() → void
Disposes this disposable and any resources it has open.
inherited
focus() → void
Item/component focuses itself
inherited
handleClick() → void
handleKeyDown(KeyboardEvent event) → void
handleKeyPress(KeyboardEvent event) → void
handleKeyUp(KeyboardEvent event) → void
ngOnDestroy() → void
Executed before the directive is removed from the DOM and destroyed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onBlur() → void
onDisabledChanged(bool isDisabled) → void
This function is called when the control status changes to or from "DISABLED".
onFocus() → void
registerOnChange(ChangeFunction<bool> callback) → void
Set the function to be called when the control receives a change event.
registerOnTouched(TouchFunction _) → void
Set the function to be called when the control is touched.
select() → void
toString() String
A string representation of this object.
inherited
writeValue(bool isChecked) → void
Write a new value to the element.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

hostClass → const String