NgxControlError is a structural directive for displaying form control errors consistently while reducing boilerplate.
Import
Usage
The template will be rendered, when the control is in an error state and its errors include the tracked error(s).
without NgxControlError:
Configuration
A StateMatcher defines when the provided control is in an error state.
A StateMatcher is a function which returns an observable. Every time the StateMatcher emits a value, the directive checks whether it should render or hide its template:
The directive renders its template when the StateMatcher emits true and the errors of the control include at least 1 tracked error, else its template will be hidden.
Per default the control is considered in an error state when 1. its status is INVALID and 2. it is touched or its form has been submitted.