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

Method _dirtyCheckPlaceholder

src/material/input/input.ts:467–476  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

Callers 1

ngDoCheckMethod · 0.95

Calls 1

_getPlaceholderMethod · 0.95

Tested by

no test coverage detected