Building a Phone Number Input the Right Way

Let's explore the different types of forms in Angular.

The right way

Now, how would we build a phone number input the right way? A good form input should:

  • Clearly show what sort of format is recommended.

  • Accept all kinds of formats, regardless of whether they’re pasted, typed, or entered through the browser’s autofill tool.

  • Reformat the phone number in an easy-to-read way if possible.

  • Clearly indicate problems when they occur and what needs to be done to fix them.

This is possible using just techniques from the first section of this course.

Get hands-on with 1200+ tech skills courses.