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

Method _initializeSubscript

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

536 * to be able to validate and synchronize ids on change.
537 */
538 private _initializeSubscript() {
539 // Re-validate when the number of hints changes.
540 this._hintChildren.changes.subscribe(() => {
541 this._processHints();
542 this._changeDetectorRef.markForCheck();
543 });
544
545 // Update the aria-described by when the number of errors changes.
546 this._errorChildren.changes.subscribe(() => {
547 this._syncDescribedByIds();
548 this._changeDetectorRef.markForCheck();
549 });
550
551 // Initial mat-hint validation and subscript describedByIds sync.
552 this._validateHints();
553 this._syncDescribedByIds();
554 }
555
556 /** Throws an error if the form field's control is missing. */
557 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