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

Method _validateHints

src/material/form-field/form-field.ts:735–753  ·  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

733 * This method is a noop if Angular runs in production mode.
734 */
735 private _validateHints() {
736 if (this._hintChildren && (typeof ngDevMode === 'undefined' || ngDevMode)) {
737 let startHint: MatHint;
738 let endHint: MatHint;
739 this._hintChildren.forEach((hint: MatHint) => {
740 if (hint.align === 'start') {
741 if (startHint || this.hintLabel) {
742 throw getMatFormFieldDuplicatedHintError('start');
743 }
744 startHint = hint;
745 } else if (hint.align === 'end') {
746 if (endHint) {
747 throw getMatFormFieldDuplicatedHintError('end');
748 }
749 endHint = hint;
750 }
751 });
752 }
753 }
754
755 /**
756 * 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