Tiven Wang
Wang Tiven March 26, 2018
425 favorite favorites
bookmark bookmark
share share

Angular reactive forms facilitate a reactive style of programming that favors explicit management of the data flowing between a non-UI data model (typically retrieved from a server) and a UI-oriented form model that retains the states and values of the HTML controls on screen. Reactive forms offer the ease of using reactive patterns, testing, and validation.

The component must copy the hero values in the data model into the form model. There are two important implications:

  • The developer must understand how the properties of the data model map to the properties of the form model.
  • User changes flow from the DOM elements to the form model, not to the data model. The form controls never update the data model.

Import Reactive Forms Module

Registering the reactive forms module

import { ReactiveFormsModule } from '@angular/forms';

  imports: [
    // other imports ...
export class AppModule { }




Similar Posts


Back to Top