anchor.diff:    It demands its own instance of the `HeroService` to get heroes
     and displays them in the order they arrive from the database.
     
  +  `HeroesBaseComponent`能自己独立运行。它在自己的实例里要求`HeroService`，用来得到英雄，并将它们按照数据库返回的顺序显示出来。
  +  
   +makeExample('cb-dependency-injection/ts/app/sorted-heroes.component.ts','heroes-base','app/sorted-heroes.component.ts (HeroesBaseComponent)') 
   .l-sub-section
     :marked
  
positive.code:   But Angular calls the *derived* class's `ngOnInit` *before* calling the base class's `ngOnInit` 
    so we'd be sorting the heroes array *before they arrived*. That produces a nasty error.
    
    Overriding the base class's `_afterGetHeroes` method solves the problem
    
    These complications argue for *avoiding component inheritance*. 
  
  a(id="find-parent")
  .l-main-section
  :marked
    ## Find a parent component by injection
    
    Application components often need to share information.
    We prefer the more loosely coupled techniques such as data binding and service sharing.
    But sometimes it makes sense for one component to have a direct reference to another component
    perhaps to access values or call methods on that component.
     
    Obtaining a component reference is a bit tricky in Angular.
    Although an Angular application is a tree of components,
  
negative.code:   The `SortedHeroesComponent` lets the base class fetch the heroes.
    (we said it was contrived).
    
    用户希望看到英雄按字母顺序排序。与其修改原始的组件，我们衍生它，建立一个`SortedHeroesComponent`，用来在展示英雄之前进行排序。
    该`SortedHeroesComponent`让基本类来获取英雄。（我们说过这个是人为的）。
    
    Unfortunately, Angular cannot inject the `HeroService` directly into the base class.
    We must provide the `HeroService` again for *this* component, 
    then pass it down to the base class inside the constructor.
    
    可惜，Angular不能直接在基本类里直接注入`HeroService`。我们必须在*这个*组件里再次提供`HeroService`，然后通过构造函数传给基础类。
      
  +makeExample('cb-dependency-injection/ts/app/sorted-heroes.component.ts','sorted-heroes','app/sorted-heroes.component.ts (SortedHeroesComponent)') 
  :marked
  