Reactive forms
Reactive forms use a declarative and explicit approach to creating and manipulating form data. Let’s put this concept into practice by creating a new form for our project.
First, on the command line, let’s use the Angular CLI to generate the new component:
ng g c diary/new-entry-form-reactive
In the same way as we did with the template-driven form, let’s add this new component to the DiaryRoutingModule
routing module:
import { NewEntryFormReactiveComponent } from './new-entry-form-reactive/new-entry-form-reactive.component'; const routes: Routes = [ { path: '', component: DiaryComponent, }, { path: 'new-template', component: NewEntryFormTemplateComponent, }, { path: 'new-reactive', component: NewEntryFormReactiveComponent...