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...