Exercise: Handle Multiple Elements with Directives

Let’s practice handling multiple elements using directives.

We'll cover the following

It’s time to practice what we learned about ViewChildren. This task will be about gathering all input data from a user.

Objectives

Let’s assume we have a simple form with multiple inputs that has been dynamically made. Each input field can contain any text. When a user clicks the “Save” button, we have to log all the provided texts into the console.

To make things a little more complex, we also need a button to add a new input field.

So, to sum up, we must:

  • Log all input values into the console when “Save” is clicked.
  • Implement a button to add a new input field.

Get hands-on with 1400+ tech skills courses.