Form Controls: Select & Checkbox

Learn to use the select and checkbox form controls.

We'll cover the following

We’ll learn how to add a select component in the form to select multiple product categories.

The select component

The select component works similarly to the native <select> element defined in the HTML standard. It displays a drop-down element with a list of options that users can choose. It allows selecting only one option at a time by default, but it can also be configured for multiple selections, as we will see in this example.

We will add a select component in the ProductCreate component to add multiple categories to a new product:

  1. Open the products.module.ts file and add the following import statement:

Get hands-on with 1400+ tech skills courses.