8 Building custom directives and pipes

This chapter covers

  • How to create your own directives
  • The difference between structural and attribute directives
  • How to use a directive to modify another component
  • How to craft custom pipes
  • What pipe purity is and how to design stateful or stateless pipes

Angular ships with a number of directives and pipes for the broadest use cases. Chapter 3 covered the defaults, so you can review what they are and how they’re used. This includes directives such as NgFor and NgIf for iterating over a list or conditionally displaying items, and pipes such as Currency and Number for formatting values for currency or number display.

This chapter focuses on creating custom directives and pipes and talks about why you ...

Get Angular in Action 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.