MCPcopy Create free account
hub / github.com/angular/components / MatInput

Class MatInput

src/material/input/input.ts:96–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94 providers: [{provide: MatFormFieldControl, useExisting: MatInput}],
95})
96export class MatInput
97 implements MatFormFieldControl<any>, OnChanges, OnDestroy, AfterViewInit, DoCheck
98{
99 protected _elementRef =
100 inject<ElementRef<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>>(ElementRef);
101 protected _platform = inject(Platform);
102 ngControl = inject(NgControl, {optional: true, self: true})!;
103 private _autofillMonitor = inject(AutofillMonitor);
104 private _ngZone = inject(NgZone);
105 protected _formField? = inject<MatFormField>(MAT_FORM_FIELD, {optional: true});
106 private _renderer = inject(Renderer2);
107
108 protected _uid = inject(_IdGenerator).getId('mat-input-');
109 protected _previousNativeValue: any;
110 private _inputValueAccessor!: {value: any};
111 private _signalBasedValueAccessor?: {value: WritableSignal<any>};
112 private _previousPlaceholder: string | null = null;
113 private _errorStateTracker: _ErrorStateTracker;
114 private _config = inject(MAT_INPUT_CONFIG, {optional: true});
115 private _cleanupIosKeyup: (() => void) | undefined;
116 private _cleanupWebkitWheel: (() => void) | undefined;
117
118 /** Whether the component is being rendered on the server. */
119 readonly _isServer: boolean = false;
120
121 /** Whether the component is a native html select. */
122 readonly _isNativeSelect: boolean = false;
123
124 /** Whether the component is a textarea. */
125 readonly _isTextarea: boolean = false;
126
127 /** Whether the input is inside of a form field. */
128 readonly _isInFormField: boolean = false;
129
130 /**
131 * Implemented as part of MatFormFieldControl.
132 * @docs-private
133 */
134 focused: boolean = false;
135
136 /**
137 * Implemented as part of MatFormFieldControl.
138 * @docs-private
139 */
140 readonly stateChanges: Subject<void> = new Subject<void>();
141
142 /**
143 * Implemented as part of MatFormFieldControl.
144 * @docs-private
145 */
146 controlType: string = 'mat-input';
147
148 /**
149 * Implemented as part of MatFormFieldControl.
150 * @docs-private
151 */
152 autofilled = false;
153

Callers

nothing calls this directly

Calls 3

getSupportedInputTypesFunction · 0.90
getIdMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected