ionic form example
Example 1: ionic form example
// in component.ts
this.myForm = formBuilder.group({
firstName: ['value'],
lastName: ['value', *validation function goes here*],
age: ['value', *validation function goes here*, *asynchronous validation function goes here*]
});
...
// in component.html
Example 2: ionic email validation
[Validators.required, Validators.pattern(/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/)]