anchor.diff:          We create a `SpyDirective` that logs when the element it spies upon is 
           created or destroyed using the `ngOnInit` and `ngOnDestroy` hooks.
           
  +        指令也有生命周期钩子。我们新建一个`SpyDirective`，利用`ngOnInit`和`ngOnDestroy`钩子，在每个被监视的元素被新建或销毁时输出日志。
  +        
           We apply the `SpyDirective` to a `<div>` in an `ngFor` *hero* repeater
           managed by the parent `SpyComponent`.
  +        
  +        我们把`SpyDirective`应用到一个在父级组件里的`ngFor`*英雄*重复器的`<div>`里面。
     tr(style=top)
       td <a href="#onchanges">OnChanges</a>
       td
  
positive.code:         See how Angular calls the `ngOnChanges` hook with a `changes` object
          every time one of the component input properties changes.
          Shows how to interpret the `changes` object.
    tr(style=top)
      td <a href="#docheck">DoCheck</a> 
      td
  
negative.code:     td
        :marked
          Initialize the directive/component after Angular initializes the data-bound input properties.
          
          在Angular初始化数据绑定输入属性后，用来初始化指令或组件。
    tr(style=top)
      td ngOnChanges
      td
        :marked
          Respond after Angular sets a data-bound input property. 
          The method receives a `changes` object of current and previous values.
          
          在Angular设置一个数据绑定输入属性后作出反应。这个方法接受一个包含了当前和之前的值的`changes`对象。
    tr(style=top)
      td ngDoCheck
      td
        :marked
          Detect and act upon changes that Angular can or won't
          detect on its own. Called every change detection run.
          
          用来监测Angular自己可以或者不会检测的变化，并作出相应行动。贼每个变化监测运行时被调用。
    tr(style=top)
      td ngOnDestroy
      td
        :marked
          Cleanup just before Angular destroys the directive/component. 
          Unsubscribe observables and detach event handlers to avoid memory leaks.
          
          在Angular销毁指令或组件之前做一些清洁工作，不如退订监测和分离时间处理器，以防内存泄露。
  
  :marked
    ### Components only
  
    ### 只适用于组件
  
  table(width="100%")
    col(width="20%")
  