Template Driven Forms
Learn how to create template-driven forms in Ionic applications.
The final way we can build forms for our apps involves removing the logic from the class and implementing it directly within the form itself.
Let’s look at how this works by creating a template-driven form.
Creating a new project
Using the Ionic CLI, we create the project as follows:
ionic start template-form blank --type=angular
The home component
We’ll start by editing the class, as this is the most straightforward part of our application to work with, unlike the previous examples of form validation that we’ve covered.
In the template-form/src/app/home/home.page.ts
file, we make the following amendment (highlighted):
Get hands-on with 1400+ tech skills courses.