Skip to main content

Posts

Showing posts with the label Angular 6 Forms

Angular 6 Forms Validation Example - [Required, Email, URL, Dropdown and Min-Max min-length]

In this article, I will show you how to setup form validation in Angular 6 .   Also, I am using a simple registration form with standard fields – 1.        Name 2.        Email 3.       Gender 4.       Country 5.       Site URL 6.       Password All fields are required, plus the email field must be a valid email address, site URL field must be a valid URL and the password field must have a min-length of 6. Steps involved as following – 1.        Create a project with the help of CLI command – ng g new Project_Name 2.        Go to the created project directory 3.       Create customer components with the help of CLI command – ng g component comp_name 4.       Import the FormsModule, Router...