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

Method _initializeSubscript

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

* Initializes the subscript by validating hints and synchronizing "aria-describedby" ids * with the custom form field control. Also subscribes to hint and error changes in order * to be able to validate and synchronize ids on change.

()

Source from the content-addressed store, hash-verified

521 * to be able to validate and synchronize ids on change.
522 */
523 private _initializeSubscript() {
524 // Re-validate when the number of hints changes.
525 this._hintChildren.changes.subscribe(() => {
526 this._processHints();
527 this._changeDetectorRef.markForCheck();
528 });
529
530 // Update the aria-described by when the number of errors changes.
531 this._errorChildren.changes.subscribe(() => {
532 this._syncDescribedByIds();
533 this._changeDetectorRef.markForCheck();
534 });
535
536 // Initial mat-hint validation and subscript describedByIds sync.
537 this._validateHints();
538 this._syncDescribedByIds();
539 }
540
541 /** Throws an error if the form field's control is missing. */
542 private _assertFormFieldControl() {

Callers 1

ngAfterContentInitMethod · 0.95

Calls 4

_processHintsMethod · 0.95
_syncDescribedByIdsMethod · 0.95
_validateHintsMethod · 0.95
markForCheckMethod · 0.80

Tested by

no test coverage detected