Content projection and structural directives

This section describes the techniques used to perform DOM manipulation in Angular. DOM manipulation is based on the following ideas:

  • An Angular template that encodes a chunk of HTML to be inserted and possibly repeated several times somewhere
  • The content placeholder that encodes a location to place the results of rendering Angular templates

The simplest form of DOM manipulation is content projection: content specified within the start and end tags of a component C is read as a template and projected in a location specified by a content placeholder inside of the C component template. Content projection adds the capability to include variable HTML furnished as input in the component template. The ...

Get Hands-On TypeScript for C# and .NET Core Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.