UNPKG

@angular/material

Version:
31 lines (29 loc) 947 B
class _ErrorStateTracker { _defaultMatcher; ngControl; _parentFormGroup; _parentForm; _stateChanges; errorState = false; matcher; constructor(_defaultMatcher, ngControl, _parentFormGroup, _parentForm, _stateChanges) { this._defaultMatcher = _defaultMatcher; this.ngControl = ngControl; this._parentFormGroup = _parentFormGroup; this._parentForm = _parentForm; this._stateChanges = _stateChanges; } updateErrorState() { const oldState = this.errorState; const parent = this._parentFormGroup || this._parentForm; const matcher = this.matcher || this._defaultMatcher; const control = this.ngControl ? this.ngControl.control : null; const newState = matcher?.isErrorState(control, parent) ?? false; if (newState !== oldState) { this.errorState = newState; this._stateChanges.next(); } } } export { _ErrorStateTracker }; //# sourceMappingURL=_error-state-chunk.mjs.map