anchor.diff:    img(src='/resources/images/devguide/structural-directives/template-in-out-of-a2.png' alt="template outside angular")
   
   :marked
  -  Evidently Angular replaces the `&lt;template>` tag and its contents with empty `&lt;script>` tags.
  +  Evidently Angular replaces the `<template>` tag and its contents with empty `<script>` tags.
     That's just its default behavior.
  -  It can do something different as we saw when applying a variety of `ngSwitch` directives to `&lt;template>` tags:
  -
  -  显然，Angular把`&lt;template>`标签及其内容替换成了一个空白的`&lt;script>`标签。
  +  It can do something different as we saw when applying a variety of `ngSwitch` directives to `<template>` tags:
  +
  +  显然，Angular把`<template>`标签及其内容替换成了一个空白的`<script>`标签。
     这只是它的默认行为。
  -  当把`ngSwitch`家族的各种指令应用于`&lt;template>`标签时，我们就会看到有些东西不一样了：
  +  当把`ngSwitch`家族的各种指令应用于`<template>`标签时，我们就会看到有些东西不一样了：
   
   +makeExample('structural-directives/ts/app/structural-directives.component.html', 'ngSwitch')(format=".")
   :marked
  
positive.code:   - [学习什么是结构型(structural)指令](#definition)
    - [study *ngIf*](#ngIf)
    - [研究*ngIf*](#ngIf)
    - [discover the &lt;template> element](#template)
    - [&lt;template>元素揭秘](#template)
    - [understand the asterisk (\*) in **ngFor*](#asterisk)
    - [理解**ngFor*中的星号(\*)](#asterisk)
    - [write our own structural directive](#unless)
  
negative.code:   using the built-in `ngOnInit` and `ngOnDestroy` [lifecycle hooks](lifecycle-hooks.html).
    Here it is in action:
  
    借助内建的`ngOnInit`和`ngOnDestroy`[生命周期钩子](lifecycle-hooks.html)，我们同时记录了组件的创建或销毁过程。
    下面是它的操作效果：
  
  figure.image-display
  