Search⌘ K

Summary

Explore Angular structural directives to understand how they dynamically manipulate the DOM. Learn to generate custom directives with Angular CLI, use asterisk syntax for templates, and employ TemplateRef with ViewContainerRef to render or clear views. Gain practical knowledge on input and output properties for binding data in directives to improve your project's dynamic UI control.

Let’s highlight the most important things we need to remember about structural directives.

Generate file

To generate the directive file using Angular CLI, we use the following command which is the same as an attribute directive:

ng generate directive app-custom-directive

Directive syntax

The empty directive class looks ...