Search⌘ K
AI Features

Creating the Pizza View

Explore how to create a dynamic pizza order form using Angular reactive forms. Understand how to use FormArray to handle multiple pizzas, bind controls with FormGroupName, and manage user input for size and toppings efficiently.

Pizza form view

The pizzaModel is where the meat of this form exists (as well as the dough, tomato sauce, and other toppings). It’s set up at the root as an array (who orders just one pizza?), so we’ll ...

TypeScript 3.3.4
get pizzas(): FormArray {
return this.pizzaForm.get('pizzas') as FormArray;
}
addPizza() {
this.pizzas.push(this.fb.group(new Pizza()));
}

Now that the boilerplate is out of the way, it’s time to start ...