anchor.diff:    ### NgStyle
     We can set inline styles dynamically, based on the state of the component.
     Binding to `NgStyle` lets us set many inline styles simultaneously.
  -
  +  
     我们可以基于组件的状态动态设置内联样式。
     绑定到`NgStyle`可以让我们同时设置很多内联样式。
   
     A [style binding](#style-binding) is an easy way to set a *single* style value.
  -
  +  
     [样式绑定](#style-binding)是设置*单一*样式值的简单方式。
  -
   +makeExample('template-syntax/ts/app/app.component.html', 'NgStyle-1')(format=".")
   :marked
     The `NgStyle` directive may be the better choice
     when we want to set *many* inline styles at the same time.
  -
  +  
     如果我们要同时设置*多个*内联样式，`NgStyle`指令可能是更好的选择。
   
     We apply `NgStyle` by binding it to a key:value control !{__objectAsMap}.
     Each key of the object is a style name; its value is whatever is appropriate for that style.
  -
  +  
     我们通过把它绑定到一个 key:value 控制对象的形式使用`NgStyle`。
     对象的每个key是样式名，它的value就是能用于这个样式的任何值。
   
     Consider a component method such as `setStyles` that returns an object defining three styles:
  -
  +  
     考虑一个类似于`setStyles`的组件方法，它返回一个定义三种样式的对象：
  -
   +makeExample('template-syntax/ts/app/app.component.ts', 'setStyles')(format=".")
   :marked
     Now we just add an `NgStyle` property binding that calls `setStyles`
     and sets the element's styles accordingly:
  -
  +  
     现在我们添加一个`NgStyle`属性绑定，让它调用`setStyles`，并据此设置元素的样式：
  -
   +makeExample('template-syntax/ts/app/app.component.html', 'NgStyle-2')(format=".")
   
   <a id="ngIf"></a>
  
positive.code:   ### 输入/输出属性的别名
  
    Sometimes we want the public name of an input/output property to be different from the internal name.
  
    有时我们需要让输入/输出属性的公开名字不同于内部名字。
  
    This is frequently the case with [attribute directives](attribute-directives.html).
    Directive consumers expect to bind to the name of the directive.
    For example, when we apply a directive with a `myClick` selector to a `<div>` tag,
    we expect to bind to an event property that is also called `myClick`.
  
    这是使用[属性(Attribute)型指令](attribute-directives.html)时的常见情况。
  
  +makeExample('template-syntax/ts/app/app.component.html', 'my-click')(format=".")
  :marked
    However, the directive name is often a poor choice for the name of a property within the directive class.
    The directive name rarely describes what the property does.
    The `myClick` directive name is not a good name for a property that emits click messages.
  
    无论如何，在指令类中，直接用指令名作为属性名通常都不是好的选择。
    指令名很少能描述这个属性是干嘛的。
    `myClick`这个指令名对于用来发出click消息的属性就算不上一个好名字。
  
negative.code:     can’t refer to `window` or `document`. They can’t call `console.log` or
      `Math.max`.
  
  :marked
    The *onSave* in `(click)="onSave()"` is sure to be a method of the data-bound component instance.
    
    `(click)="onSave()"`中的*onSave*就是数据绑定组件实例中的一个方法。
  
    The statement context may include an object other than the component.
    A [template reference variable](#ref-vars) is one such alternative context object.
    We'll frequently see the reserved `$event` symbol in event binding statements,
    representing the "message" or "payload" of the raised event.
    
    语句上下文可以包含组件之外的对象。
    [模板引用对象](#ref-vars)就是这些候选上下文对象中的一个。
    在事件绑定语句中，我们将频繁的看到被保留的`$event`符号，它代表来自所触发事件的“消息”或“有效载荷”。
  