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

Method _dirtyCheckPlaceholder

src/material/input/input.ts:469–478  ·  view source on GitHub ↗

Does some manual dirty checking on the native input `placeholder` attribute.

()

Source from the content-addressed store, hash-verified

467
468 /** Does some manual dirty checking on the native input `placeholder` attribute. */
469 private _dirtyCheckPlaceholder() {
470 const placeholder = this._getPlaceholder();
471 if (placeholder !== this._previousPlaceholder) {
472 const element = this._elementRef.nativeElement;
473 this._previousPlaceholder = placeholder;
474 placeholder
475 ? element.setAttribute('placeholder', placeholder)
476 : element.removeAttribute('placeholder');
477 }
478 }
479
480 /** Gets the current placeholder of the form field. */
481 protected _getPlaceholder(): string | null {

Callers 1

ngDoCheckMethod · 0.95

Calls 1

_getPlaceholderMethod · 0.95

Tested by

no test coverage detected