Reputation: 1060
Working in Angular 6 and I'm seeing some pages where we have:
<div [formGroup]="form">
and others where it is:
<form [formGroup]="form">
Does it make any difference where the formGroup directive is placed?
Upvotes: 0
Views: 33
Reputation: 15041
For the directive FormGroup, it doesn't really matter, you can use a reactive form with either of these.
But if you intend to use ngSubmit
, you'd have to use <form [formGroup]="form">
because it wouldn't work with <div [formGroup]="form">
Upvotes: 1