Skip to content

Instantly share code, notes, and snippets.

@sannonaragao
sannonaragao / About-the-input-validation-component.txt
Last active April 5, 2024 15:29
An input validation message to use with PrimeNG
It's a component to validate required fields, minimun length, patterns and custom validations.
Example 1 : Validate: required, minlength and a pattern.
some.component.html
<input pInputText type="text" name="email" [(ngModel)]="user.email"
ngModel #email="ngModel" required minlength="5"
pattern="^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$">
<app-input-validation [control]="email"