anchor.diff:  
   a(href="#toc") Back to top
   
  +a(href="#toc") 回到顶部
  +
   .l-main-section
   :marked
     ### Use the @Injectable() Class Decorator
  +  ### 使用@Injectable()类装饰器
     <a id="07-04"></a>
     #### Style 07-04
  +  #### 风格07-04
   
   .s-rule.do
     :marked
       **Do** use the `@Injectable` class decorator instead of the `@Inject` parameter decorator when using types as tokens for the dependencies of a service.
  +    
  +    **采用** 当使用类型作为服务的依赖的令牌的时候，使用`@Injectable`类装饰器，而非`@Inject`参数装饰器
   
   .s-why
     :marked
       **Why?** The Angular DI mechanism resolves all the dependencies of our services based on their types declared with the services' constructors.
  +    
  +    **为何？** Angular依赖注入机制，是根据在服务的构造函数里面的类型的声明，来解析所有服务的依赖的。
   
   .s-why.s-why-last
     :marked
       **Why?** When a service accepts only dependencies associated with type tokens, the `@Injectable()` syntax is much less verbose compared to using `@Inject()` on each individual constructor parameter.
  +    
  +    **为何？** 当一个服务只接受类型令牌相关的依赖时，比起每个构造函数参数上使用`@Inject()`来，`@Injectable()`语法简洁多了。
   
   +makeExample('style-guide/ts/07-04/app/heroes/shared/hero-arena.service.avoid.ts', 'example', 'app/heroes/shared/hero-arena.service.ts')(avoid=1)
   :marked
  
positive.code:   :marked
      **Do** define one thing (e.g. service or component) per file.
      
      **做** 每个文件定义一个东西（比如服务或者组件）。
  
  .s-rule.consider
    :marked
  
negative.code: 
    Have a near term view of implementation and a long term vision. Start small but keep in mind where the app is heading down the road.
    
    准备一个短期的执行方案和一个长期的执行方案。从零开始，但是时刻考虑应用接下来要走的路。
  
    All of the app's code goes in a folder named `app`. All content is 1 feature per file. Each component, service, and pipe is in its own file. All 3rd party vendor scripts are stored 
    in another folder and not in the `app` folder. We didn't write them and we don't want them cluttering our app. Use the naming conventions for files in this guide.
    
    把所有的应用源代码都放到一个名叫`app`的目录里。所有内容都遵循一个特征一个文件。每个组件、服务和管道都在自己的文件里。所有第三方程序包都被保存到其他目录里，并确保不在`app`目录里。
    我们不会修改他们，所以我们不希望他们弄乱我们的应用。使用本指南介绍的文件命名规则。
  
  a(href="#toc") Back to top
  
  