anchor.diff:    `)
   :marked
     ## The Road We’ve Travelled
  +  ## 走过的路
     Let’s take stock of what we’ve built.
  +  
  +  来盘点一下我们已经构建完的部分。  
   
     * We created a service class that can be shared by many components
  +  * 我们创建了一个能被多个组件共享的服务类
     * We used the `ngOnInit` Lifecycle Hook to get our heroes when our `AppComponent` activates
  +  * 我们使用`ngOnInit`生命周期钩子，以便在`AppComponent`激活时获取英雄数据。
     * We defined our `HeroService` as a provider for our `AppComponent`
  +  * 我们把`HeroService`定义为`AppComponent`的一个供应商（provider）
     * We created mock hero data and imported them into our service
  +  * 我们创建了一个模拟的英雄数据，并且把它导入我们的服务中
     * We designed our service to return a promise and our component to get our data from the promise
  +  * 我们把服务改造为返回承诺的，并且让组件从承诺获取数据
   
     [Run the live example for part 4](/resources/live-examples/toh-4/ts/plnkr.html)
  +  
  +  [运行第四部分的鲜活范例](/resources/live-examples/toh-4/ts/plnkr.html)
   
     ### The Road Ahead
  +  ### 前方的路
     Our Tour of Heroes has become more reusable using shared components and services.
     We want to create a dashboard, add menu links that route between the views, and format data in a template.
     As our app evolves, we’ll learn how to design it to make it easier to grow and maintain.
     
  +  通过使用共享组件和服务，我们的《英雄之旅》具有了更高的可复用性。
  +  我们还要创建一个黑板报，还要添加菜单链接，路由到各个视图，还要在模板中格式化数据。
  +  随着我们应用的进化，我们还会学到如何进行设计，让它更容易扩展和维护。
  +  
     We learn about Angular Component Router and navigation among the views in the [next tutorial](toh-pt5.html) chapter.
  +  
  +  我们将在[下一章](toh-pt5.html)学习Angular组件路由，以及在视图间导航的知识。
     
   .l-main-section
   <a id="slow"></a>
   :marked
     ### Appendix: Take it slow
  +  ### 附件：慢一点儿
     
     We can simulate a slow connection.
     
  +  我们可以模拟慢速连接。
  +  
     Import the `Hero` symbol and add the following `getHeroesSlowly` method to the `HeroService`
  +  
  +  导入`Hero`类，并且在`HeroService`中添加如下的`getHeroesSlowly`方法：
   +makeExample('toh-4/ts/app/hero.service.ts', 'get-heroes-slowly', 'hero.service.ts (getHeroesSlowy)')(format=".")
   :marked
     Like `getHeroes`, it also returns a promise. 
     But this promise waits 2 seconds before resolving the promise with mock heroes.
     
  +  像`getHeroes`一样，它也返回一个承诺。
  +  但是，这个承诺会在使用模拟数据完成任务之前等待两秒钟。
  +  
     Back in the `AppComponent`, replace `_heroService.getHeroes` with `_heroService.getHeroesSlowly`
     and see how the app behaves.
     
  +  回到`AppComponent`中，把`_heroService.getHeroes`替换为`_heroService.getHeroesSlowly`，看看应用的行为有什么变化。
  +  
   .l-main-section
   <a id="shadow-provider"></a>
   :marked
     ### Appendix: Shadowing the parent's service
  +  ### 附件：遮蔽父组件的服务
     
     We stated [earlier](#child-component) that if we injected the parent `AppComponent` `HeroService`
     into the `HeroDetailComponent`, *we must not add a providers array* to the `HeroDetailComponent` metadata.
  -
  +  
  +  我们在[前面](#child-component)说过，如果我们把父组件`AppComponent`中的`HeroService`服务注入到`HeroDetailComponent`， 
  +  *我们就不应该添加一个providers数组* 到`HeroDetailComponent`的元数据中。
  +  
     Why?  Because that tells Angular to create a new instance of the `HeroService` at the `HeroDetailComponent` level.
     The `HeroDetailComponent` doesn't want its *own*  service instance; it wants its *parent's* service instance.
     Adding the `providers` array creates a new service instance that shadows the parent instance.
     
  +  为什么呢？因为那会告诉Angular在`HeroDetailComponent`这一层创建一个新的`HeroService`实例。
  +  显然，在这个例子中，`HeroDetailComponent`不会希望创建 *自己的* 服务实例，它想要的是就父组件的服务实例。
  +  给组件添加一个`providers`数组（即：注册provider），就会创建一个新的服务实例，它会遮蔽父组件中的同名实例。
  +  
     Think carefully about where and when to register a provider. 
     Understand the scope of that registration. Be careful not to create a new service instance at the wrong level.
  +
  +  要想清楚，在哪里、在什么时候注册供应商（provider）。要理解注册的范围。小心！不要在错误的级别创建新的服务实例。
  
positive.code:     .file typings.json
  :marked
    Here are the code files we discussed in this chapter.
  
  +makeTabs(`
    toh-4/ts/app/hero.service.ts,
  
negative.code:   Because data services are invariably asynchronous, 
    we'll finish the chapter with a promise-based version of the data service.
  
    因为数据服务通常都是异步的，所以在本章的最后，我们会把它重构为基于承诺（Promise，一种异步编程模式）的版本。
  :marked
    [Run the live example for part 4](/resources/live-examples/toh-4/ts/plnkr.html)
    
  