* 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.
()
| 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() { |
no test coverage detected