Creating a New Project
In this lesson, we'll create a new project to learn about template forms in Angular.
We'll cover the following
In this section, the project we’ll be working on is a form for an email. We’ll be working with a much simpler example this time because there’s not much to learn about template forms. Actually, you are already familiar with some of the concepts around template forms. I’ll show you how in the upcoming lessons.
If you’re running code locally, then you’ll need to run the following command:
ng new email-form
During the setup process, the CLI will ask you to configure the project. The default settings work fine. We won’t need routing for this project.
Installing Bootstrap
After installing the project, navigate to the newly created directory, and install Bootstrap. We’ll be using it to help us with styles. You can run the following command to install Bootstrap:
npm i bootstrap
We’ll need to update the styles.css
file to import Bootstrap.
@import "bootstrap/dist/css/bootstrap.css"
Creating a new form
We’ll quickly create the form we’ll be working on in this project. Inside the app.component.html
file, replace the default contents with the following:
Get hands-on with 1400+ tech skills courses.