when I use the Model-Driven form, for example:
@Component({
selector: 'my-app',
template: `
<p>
<label>First Name:</label>
<input type="text" [ngModel]="user.firstName" required>
</p>
`,
providers: [myService]
})
and when I use the Driven pattern, for example:
@Component({
selector: 'my-app',
template: `
<p>
<label>First Name:</label>
<input type="text" formControlName="firstName">
</p>
`,
providers: [myService]
})
I think both things perform the same functionality. so i get a little confusion which is preferable when you start a new project?
source
share