block includes include ../_util-fns :marked One of the defining features of a single page application is its manipulation of the DOM tree. Instead of serving a whole new page every time a user navigates, whole sections of the DOM appear and disappear according to the application state. In this chapter we'll to look at how Angular manipulates the DOM and how we can do it ourselves in our own directives. 单页面应用的基本特性之一,就是它要操纵DOM树。不同于以前那种用户每次浏览都重新从服务器取得整个页面的方式, 单页面应用中,DOM中的各个区域会根据应用程序的状态而出现或消失。 在本章中,我们将看看Angular如何操纵DOM树,以及我们该如何在自己的指令中这么做。 In this chapter we will 在本章中,我们将: - [learn what structural directives are](#definition) - [学习什么是结构型(structural)指令](#definition) - [study *ngIf*](#ngIf) - [研究*ngIf*](#ngIf) - [discover the `