From the course: Learning the Angular CLI

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Generating pipes

Generating pipes - Angular Tutorial

From the course: Learning the Angular CLI

Start my 1-month free trial

Generating pipes

- [Victor] Let's see how we can generate a pipe for correctly displaying phone numbers. At your terminal, let's type in NG generate pipe. And we want to place this in a pipes folder and the name of our pipe will be called phone. A new pipes folder was created and it was also added to the main application module. If we take a look at the generated pipe file, a boilerplate class and test file were created. Pipes in Angular must implement the pipe transform interface and has one method, the transform method that must be implemented. From here, you can modify in order to implement the correct logic.

Contents