@title Structural Directives @intro Angular has a powerful template engine that lets us easily manipulate the DOM structure of our elements. @description This guide looks at how Angular manipulates the DOM with **structural directives** and how you can write your own structural directives to do the same thing. ### Table of contents - [What are structural directives?](guide/structural-directives#definition) - [*NgIf* case study](guide/structural-directives#ngIf) - [The asterisk (*) prefix](guide/structural-directives#asterisk) - [Inside *NgFor*](guide/structural-directives#ngFor) - [microsyntax](guide/structural-directives#microsyntax) - [template input variables](guide/structural-directives#template-input-variable) - [one structural directive per element](guide/structural-directives#one-per-element) - [Inside the *NgSwitch* directives](guide/structural-directives#ngSwitch) - [Prefer the (*) prefix](guide/structural-directives#prefer-asterisk) - [The <template> element](guide/structural-directives#template) - [Group sibling elements with <ng-container>](guide/structural-directives#ng-container) - [Write a structural directive](guide/structural-directives#unless) Try the . {@a definition} ## What are structural directives? Structural directives are responsible for HTML layout. They shape or reshape the DOM's _structure_, typically by adding, removing, or manipulating elements. As with other directives, you apply a structural directive to a _host element_. The directive then does whatever it's supposed to do with that host element and its descendents. Structural directives are easy to recognize. An asterisk (*) precedes the directive attribute name as in this example. No brackets. No parentheses. Just `*ngIf` set to a string. You'll learn in this guide that the [asterisk (*) is a convenience notation](guide/structural-directives#asterisk) and the string is a [_microsyntax_](guide/structural-directives#microsyntax) rather than the usual [template expression](guide/template-syntax). Angular desugars this notation into a marked-up `