Creating a complex form with input validation

In this section, you will build an app to demonstrate form validation using ngForm and ngControl. Here is a screenshot of the form:

Creating a complex form with input validation

If the user tries to submit without providing valid information, the form will show the following error:

Creating a complex form with input validation

Basically, the Name field is required. The Phone field is the number type, but is optional. The Comment field is required and the user must enter at least four characters. Of course, this is just for demonstration of the input length. The user, finally, must agree to the ...

Get Ionic 2 Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.