anchor.diff:     to the elements. Angular interprets those as well, adding validator functions to the control model.
   
      要验证用户输入，你添加[HTML验证属性](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation)到元素中。
  -   Angular拦截这些元素，添加验证器功能到控制模型中。
  +   Angular拦截这些元素，添加验证器函数到控制模型中。
   
      Angular exposes information about the state of the controls including 
      whether the user has "touched" the control or made changes and if the control values are valid.
  
positive.code: :marked
    - we inject the `FormBuilder` in a constructor.
  
    - we call a `buildForm` method in the `ngOnInit` [lifecycle hook method](../guide/lifecycle-hooks.html#hooks-overview)
    because that's when we'll have the hero data. We'll call it again in the `addHero` method.
  .l-sub-section
    :marked
      A real app would retrieve the hero asynchronously from a data service, a task best performed in the `ngOnInit` hook.
  :marked
    - the `buildForm` method uses the `FormBuilder` (`fb`) to declare the form control model.
    Then it attaches the same `onValueChanged` handler (there's a one line difference) 
    to the form's `valueChanged` event and calls it immediately 
    to set error messages for the new control model.
  
  :marked
    #### _FormBuilder_ declaration
    The `FormBuilder` declaration object specifies the three controls of the sample's hero form. 
  
    Each control spec is a control name with an array value. 
    The first array element is the current value of the corresponding hero field.
    The (optional) second value is a validator function or an array of validator functions.
    
    Most of the validator functions are stock validators provided by Angular as static methods of the `Validators` class.
    Angular has stock validators that correspond to the standard HTML validation attributes.
  
    The `forbiddenNames` validator on the `"name"` control is a custom validator, 
    discussed in a separate [section below](#custom-validation).
  
  .l-sub-section  
    :marked
      Learn more about `FormBuilder` in a _forthcoming_ chapter on reactive forms. 
  
  :marked
    #### Committing hero value changes
    
    In two-way data binding, the user's changes flow automatically from the controls back to the data model properties.
    Reactive forms do not use data binding to update data model properties. 
    The developer decides _when and how_ to update the data model from control values.
  
    This sample updates the model twice:
    1. when the user submits the form
    1. when the user chooses to add a new hero
  
    The `onSubmit` method simply replaces the `hero` object with the combined values of the form:
  +makeExample('cb-form-validation/ts/app/reactive/hero-form-reactive.component.ts','on-submit')(format='.')
  .l-sub-section
    :marked
      This example is "lucky" in that the `heroForm.value` properties _just happen_ to
      correspond _exactly_ to the hero data object properties.
  :marked
    The `addHero` method discards pending changes and creates a brand new `hero` model object.
  +makeExample('cb-form-validation/ts/app/reactive/hero-form-reactive.component.ts','add-hero')(format='.')
  :marked
    Then it calls `buildForm` again which replaces the previous `heroForm` control model with a new one.
    The `<form>` tag's `[formGroup]` binding refreshes the page with the new control model.
  
    Here's the complete reactive component file, compared to the two template-driven component files.
  +makeTabs(
    `cb-form-validation/ts/app/reactive/hero-form-reactive.component.ts,
     cb-form-validation/ts/app/template/hero-form-template2.component.ts, 
  
negative.code: 
    * add, change, and remove validation functions on the fly
  
    * 随时添加、修改和删除验证函数
  
    * manipulate the control model dynamically from within the component
  
  