2
Working with Angular Directives and Built-In Control Flow
In this chapter, you’ll learn about Angular directives in depth, with a real-world example of using a directive that highlights text on searching. You’ll also write your first structural directive and see how the ViewContainer
and TemplateRef
services work together to add/remove elements from the Document Object Model (DOM), just as in the case of *ngIf
. You’ll also create some really cool attribute directives that do different tasks. Finally, you’ll learn how to use the Directive Composition API to apply multiple directives to the same element.
Here are the recipes we’re going to cover in this chapter:
- Using attribute directives to handle the appearance of elements
- Creating a directive ...
Get Angular Cookbook - Second Edition 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.