import {MatSlideToggleModule} from '@angular/material/slide-toggle';
MatSlideToggle
Represents a slidable "switch" toggle that can be moved between on and off.
Selector: mat-slide-toggle
Exported as: matSlideToggleName | Description |
---|---|
@Input('aria-label')
|
Used to set the aria-label attribute on the underlying input element. |
@Input('aria-labelledby')
|
Used to set the aria-labelledby attribute on the underlying input element. |
@Input()
|
Whether the slide-toggle element is checked or not. |
@Input()
|
Theme color palette for the component. |
@Input()
|
Whether ripples are disabled. |
@Input()
|
Whether the component is disabled. |
@Input()
|
A unique id for the slide-toggle input. If none is supplied, it will be auto-generated. |
@Input()
|
Whether the label should appear after or before the slide-toggle. Defaults to 'after'. |
@Input()
|
Name value will be applied to the input element if present. |
@Input()
|
Whether the slide-toggle is required. |
@Output()
|
An event will be dispatched each time the slide-toggle changes its value. |
@Output()
|
An event will be dispatched each time the slide-toggle is dragged. This event is always emitted when the user drags the slide toggle to make a change greater than 50%. It does not mean the slide toggle's value is changed. The event is not emitted when the user toggles the slide toggle to change its value. |
@Output()
|
An event will be dispatched each time the slide-toggle input is toggled. This event is always emitted when the user toggles the slide toggle, but this does not mean the slide toggle's value has changed. The event does not fire when the user drags to change the slide toggle value. |
|
|
|
Returns the unique id for the visual hidden input. |
focus | |
---|---|
Focuses the slide-toggle. |
toggle | |
---|---|
Toggles the checked state of the slide-toggle. |
MatSlideToggleChange
Change event object emitted by a MatSlideToggle.
Name | Description |
---|---|
|
The new |
|
The source MatSlideToggle of the event. |
MatSlideToggleDefaultOptions
Default mat-slide-toggle
options that can be overridden.
Name | Description |
---|---|
|
Whether drag action triggers value changes in slide toggle. |
|
Whether toggle action triggers value changes in slide toggle. |
MAT_SLIDE_TOGGLE_DEFAULT_OPTIONS
Injection token to be used to override the default options for mat-slide-toggle
.
const MAT_SLIDE_TOGGLE_DEFAULT_OPTIONS: InjectionToken<MatSlideToggleDefaultOptions>;