Creating a New Project

In this lesson, we'll start working on the credit card project for learning reactive forms.

We'll cover the following

The project we’ll be working on for this section will be a credit card form. It’s one of the most common types of forms around the web. You’ll most likely deal with one eventually. As stated in the previous lesson, we’ll be using the reactive form system.

If you’re running code locally, then you’ll need to run the following command:

ng new credit-card

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 credit card form that 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 1200+ tech skills courses.