December 2017
Beginner
372 pages
10h 32m
English
Generating a pipe is similar to generating the component, as shown here:
ng generate pipe custom-sort.pipe --flat false
This command will generate the pipe and add the reference in the app.module file as well. Here also, if we don't specify the flat flag, Angular CLI will generate the pipe in the parent folder. If you have a separate folder, such as the shared folder in our case, where you will keep all your pipes, then you can navigate to that folder in the command line and then run the generate command without the flat flag.
We can use the spec and module flags similar to the way we saw in the cases of services and components.
Read now
Unlock full access