How would you validate a text input field for a twitter username, including the @ symbol?
You would use the
ngPattern directive to perform a regex match that matches Twitter usernames. The same principal can be applied to validating phone numbers, serial numbers, barcodes, zip codes and any other text input.
The official documentation can be found here.