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