12 Using the built-in directives

This chapter covers

  • Using the ngIf and ngSwitch directives to selectively include elements
  • Using the ngFor directive to generate content for each element in a sequence
  • Using micro-templates to repeat content
  • Understanding the restrictions Angular places on data binding expressions

In this chapter, I describe the built-in directives that are responsible for some of the most commonly required functionality for creating web applications: selectively including content, choosing between different fragments of content, and repeating content. I also describe some limitations that Angular puts on the expressions that are used for one-way data bindings and the directives that provide them. Table 12.1 puts the built-in ...

Get Pro Angular 16 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.