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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.