From the course: Learning the Angular CLI
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Generating pipes - Angular Tutorial
From the course: Learning the Angular CLI
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.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Creating new code with schematics49s
-
(Locked)
Generating components and modules2m 20s
-
(Locked)
Generating directives56s
-
(Locked)
Generating pipes45s
-
(Locked)
Generating route guards1m 39s
-
(Locked)
Adding libraries using schematics1m 9s
-
(Locked)
Generating custom library1m 27s
-
(Locked)
Challenge: Generating services31s
-
(Locked)
Solution: Generating services42s
-
(Locked)
-
-
-