validators.pattern angular 7 code example Example: pattern validator angular <input name="firstName" ngModel pattern="[a-zA-Z ]*">