API reference for Angular CDK text-field
import {TextFieldModule} from '@angular/cdk/text-field';
Services
AutofillMonitor
An injectable service that can be used to monitor the autofill state of an input. Based on the following blog post: https://medium.com/@brunn/detecting-autofilled-fields-in-javascript-aed598d25da7
Methods
monitor | |
---|---|
Monitor for changes in the autofill state of the given input element. |
|
Parameters | |
element Element
|
The element to monitor. |
Returns | |
Observable<AutofillEvent>
|
A stream of autofill state changes. |
monitor | |
---|---|
Monitor for changes in the autofill state of the given input element. |
|
Parameters | |
element ElementRef<Element>
|
The element to monitor. |
Returns | |
Observable<AutofillEvent>
|
A stream of autofill state changes. |
stopMonitoring | |
---|---|
Parameters | |
elementOrRef Element | ElementRef<Element>
|
|
Directives
CdkAutofill
A directive that can be used to monitor the autofill state of an input.
Selector: [cdkAutofill]
Properties
Name | Description |
---|---|
@Output()
|
Emits when the autofill state of the element changes. |
CdkTextareaAutosize
Directive to automatically resize a textarea to fit its content.
Selector: textarea[cdkTextareaAutosize]
Exported as: cdkTextareaAutosizeProperties
Name | Description |
---|---|
@Input({ alias: 'cdkTextareaAutosize', transform: booleanAttribute })
|
Whether autosizing is enabled or not |
@Input('cdkAutosizeMaxRows')
|
Maximum amount of rows in the textarea. |
@Input('cdkAutosizeMinRows')
|
Minimum amount of rows in the textarea. |
@Input()
|
Methods
reset | |
---|---|
Resets the textarea to its original size |
resizeToFitContent | |
---|---|
Resize the textarea to fit its content. |
|
Parameters | |
force boolean = false
|
Whether to force a height recalculation. By default the height will be recalculated only if the value changed since the last call. |
Type aliases
AutofillEvent
An event that is emitted when the autofill state of an input changes.
type AutofillEvent = {
target: Element;
isAutofilled: boolean;
};