form-control-errors
v0.2.0
Published
This is a package built to make displaying validation errors from Angular Form Controls easier.
Downloads
5
Maintainers
Readme
This is a package built to make displaying validation errors from Angular Form Controls easier.
Installation
In module:
import { NgFormErrorsModule } from 'form-control-errors'
...
imports: [
...
NgFormErrorsModule,
...
]
Use
<lib-form-errors [form]="exampleForm" [errorMsgs]="errorMsgs"></lib-form-errors>
form should be an Angular form group
errorMsgs should be an object of the following format
{
email: 'is not formatted correctly',
required: 'is required'
}
where the key is the error key returned by the validator and the value is the message to display