liveBook · Manning

Structural directive

A structural directive is an Angular directive that changes a template's structure by creating, removing, or transforming embedded views.

How 2 Manning books explain it

Pro Angular 16

A structural directive is an Angular directive that changes the rendered document structure by creating, removing, or repeating template content.

How it is used
Uses structural directives to add conditional content or repeat template content for data-source values.
How deep it goes
Works through template syntax, custom directive construction, module registration, and change handling, including the cost of rebuilding views.
Examples
Uses a checkbox-controlled product table, generated product rows, and page-navigation buttons.
What you can do after
Build it from scratch using @Directive, TemplateRef, ViewContainerRef, an input, and a module declaration.

Read how Pro Angular 16 explains structural directive →

Modern Angular

A structural directive is an Angular directive that changes a template's structure by creating, removing, or transforming embedded views.

How it is used
Simplifies conditional and dynamically composed Angular templates, especially repeated loading overlays and complex UI branches.
How deep it goes
Explains embedded-view creation, component projection, input updates, and lifecycle-aware changes, while deferring broader directive fundamentals.
Examples
Uses nested loading overlays, a custom loading directive, *ngIf and *ngFor, and @if conditional notification and project-card templates.
What you can do after
Build it from scratch as a standalone directive that creates embedded views, renders dynamic components, projects content, and updates inputs.

Read how Modern Angular explains structural directive →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.