anchor.diff:   The `UserContextService` needs the `LoggerService`, which the framework already has, and the `UserService`, which it has yet to create. 
    The `UserService` has no dependencies so the dependency injection framework can just `new` one into existence.
    
  - 当Angular新建一个`AppComponent`，依赖注入框架工具创建一个`LoggerService`的实例，和开始创建`UserContextService`。`UserContextService`需要框架工具已经有了的`LoggerService`和还没创建的`UserService`。
  + 当Angular新建`AppComponent`时，依赖注入框架工具创建一个`LoggerService`的实例，并开始创建`UserContextService`实例。
  + `UserContextService`需要框架工具已经创建了的`LoggerService`实例和还没创建的`UserService`实例。
    `UserService`没有其它依赖，所以依赖注入框架工具可以直接`new`一个实例。
    
    The beauty of dependency injection is that the author of `AppComponent` didn't care about any of this. 
    The author simply declared what was needed in the constructor (`LoggerService` and `UserContextService`) and the framework did the rest.
    
  - 依赖注入美丽的地方在于，`AppComponent`的作者不需要在乎这一切。作者只是在构造函数(`LoggerService`和`UserContextService`)里面简单地声明一下，框架工具来做剩下的工作。
  + 依赖注入美丽的地方在于，`AppComponent`的作者不需要在乎这一切。作者只是在(`LoggerService`和`UserContextService`的)构造函数里面简单地声明一下，框架工具来做剩下的工作。
    
    Once all the dependencies are in place, the `AppComponent` displays the user information:
    
    一旦所有依赖都准备好了，`AppComponent`显示用户信息：
  + 
   figure.image-display
     img(src="/resources/images/cookbooks/dependency-injection/logged-in-user.png" alt="Logged In User")
   :marked
     ### *@Injectable()*
     ### *@Injectable()*
  +  
     Notice the `@Injectable()`decorator on the `UserContextService` class. 
     
  -  请注意在`UserContextService`类里面的`@Injectable()`装饰器。
  +  注意在`UserContextService`类里面的`@Injectable()`装饰器。
  +  
   +makeExample('cb-dependency-injection/ts/app/user-context.service.ts','injectable','user-context.service.ts (@Injectable)')(format='.')
   :marked
     That decorator makes it possible for Angular to identify the types of its two dependencies, `LoggerService` and `UserService`.
  
positive.code:   
    We learned that dependencies can be registered at any level in the component hierarchy. 
    
    我们学习了依赖可以在任何组件级别注册依赖。
    
    When a component requests a dependency, Angular starts with that component's injector and walks up the injector tree 
    until it finds the first suitable provider.  Angular throws an error if it can't find the dependency during that walk. 
      
    当一个组件请求一个依赖，Angular以该组件注入器开始，然后往上面以及的注入器树走，知道它找到第一个合适的供应商。如果Angular不能再这个过程中找不到合适的依赖，它就抛出一个错误。
     
    We *want* this behavior most of the time. 
    But sometimes we need to limit the search and/or accommodate a missing dependency.
  
negative.code:   until it finds the logger at the `AppComponent` level. The logger logic kicks in and the hero display updates
    with the gratuituous "!!!", indicating that the logger was found.
    
    如果我们注释掉`@Host()`装饰器，Angular就会沿着注入器树往上走，直到在`AppComponent`找到该日志服务。日志服务的逻辑加入进来，更新了英雄显示，表明日志服务已找到。
  figure.image-display
    img(src="/resources/images/cookbooks/dependency-injection/hero-bio-contact-no-host.png" alt="Without @Host") 
  :marked
  