From the course: Angular Essential Training

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Using custom Angular pipes

Using custom Angular pipes - Angular Tutorial

From the course: Angular Essential Training

Using custom Angular pipes

- [Instructor] Earlier in this course, we looked at Angular pipes and why you might use them. In this video, we'll look at one of our three custom pipes and how we built it. I opened our project here in a GitHub code space. I talked about why we use code spaces earlier in this course, so for now, just think of them as an easy way to share and write code without installing anything on your local machine. Let's take a look at our custom pipe. I'll go to the source folder, open up the app folder, pipes, sort-by-score, and click on sort-by-score.pipe.ts to open the file. Always use the pipe.ts ending for your pipe files. The Angular CLI tool does this for you when you generate new pipes using the ng generate pipe command. Angular pipes are always TypeScript classes. We use the @Pipe decorator here on line 4 to declare a class has an Angular pipe. We looked at decorators earlier in this course in detail. For now, just think…

Contents