MCPcopy
hub / github.com/angular/components / _validateHints

Method _validateHints

src/material/form-field/form-field.ts:671–689  ·  view source on GitHub ↗

* Ensure that there is a maximum of one of each "mat-hint" alignment specified. The hint * label specified set through the input is being considered as "start" aligned. * * This method is a noop if Angular runs in production mode.

()

Source from the content-addressed store, hash-verified

669 * This method is a noop if Angular runs in production mode.
670 */
671 private _validateHints() {
672 if (this._hintChildren && (typeof ngDevMode === 'undefined' || ngDevMode)) {
673 let startHint: MatHint;
674 let endHint: MatHint;
675 this._hintChildren.forEach((hint: MatHint) => {
676 if (hint.align === 'start') {
677 if (startHint || this.hintLabel) {
678 throw getMatFormFieldDuplicatedHintError('start');
679 }
680 startHint = hint;
681 } else if (hint.align === 'end') {
682 if (endHint) {
683 throw getMatFormFieldDuplicatedHintError('end');
684 }
685 endHint = hint;
686 }
687 });
688 }
689 }
690
691 /**
692 * Sets the list of element IDs that describe the child control. This allows the control to update

Callers 2

_initializeSubscriptMethod · 0.95
_processHintsMethod · 0.95

Calls 1

Tested by

no test coverage detected