anchor.diff:          [Immediately Invoked Function Expression (IIFE)](https://en.wikipedia.org/wiki/Immediately-invoked_function_expression).
           These practices together prevent our code from
           polluting the global scope.
  +        
  +        我们经常在`window`上附加一个应用程序命名空间对象（比如`"app"`），然后把所有需要共享的东西都附加到这个空间对象。
  +        也可以把我们的代码包装到一个[立即调用函数表达式IIFE](https://en.wikipedia.org/wiki/Immediately-invoked_function_expression)。
  +        使用这些实践可以防止我们的代码污染全局范围。
   
         +makeExample('cb-ts-to-js/js/app/hero.component.js', 'appexport')(format="." )
   
         :marked
           We can then access anything from this shared namespace in
           other files.
  +        
  +        然后我们就可以从这个共享的命名空间来访问其他文件。
   
         +makeExample('cb-ts-to-js/js/app/main.js', 'appimport')(format="." )
   
  
positive.code:   code examples to ES5, so that they can be applied to Angular 2 JavaScript
    applications.
    
    
  
  <a id="toc"></a>
  :marked
    ## Table of contents
  
    [Modularity: imports and exports](#modularity)
  
    [Classes and Class Metadata](#class-metadata)
    
    [Input and Output Metadata](#property-metadata)
    
    [Dependency Injection](#dependency-injection)
    
    [Host and Query Metadata](#other-property-metadata)
  
    **Run and compare the live [TypeScript](/resources/live-examples/cb-ts-to-js/ts/plnkr.html) and 
    [JavaScript](/resources/live-examples/cb-ts-to-js/js/plnkr.html) code shown in this cookbook.**
  
  a(id="modularity")
  .l-main-section
  :marked
    ## Importing and Exporting
  
  - var top="vertical-align:top"
  table(width="100%")
  
negative.code:     td
        :marked
          ### Classes
          
          ### 类
  
          We put most of our Angular 2 TypeScript code into TypeScript classes.
          
          我们把绝大多数Angular 2 TypeScript代码放到TypeScript类中。
  
        +makeExample('cb-ts-to-js/ts/app/hero.component.ts', 'class')(format="." )
  
      td
        :marked
          ### Constructors and Prototypes
  
          ### 构造函数和原型
  
          ES5 JavaScript has no classes. We use the constructor
          pattern instead which works with Angular 2 as well as classes do.
          
          ES5 JavaScript不支持类。取而代之，我们使用构造模式（constructor pattern），和类一样，它可以跟Angular 2一起工作。
  
        +makeExample('cb-ts-to-js/js/app/hero.component.js', 'constructorproto')(format="." )
  
  