I just created a custom Pipe and normally I would register it in app.module.ts, but In Angular 17 we dont have that file. How do we register now? TIA
I was thinking of importing into the imports array as you would with other modules, but that didnt work. I tried checking the angular.dev site but for some reason it wont load on my laptop. Any help is appreciated.
For a standalone component, register the custom pipe in the
imports
array in.component.ts
like this:Then use the pipe in the template as usual:
The example code snippets above, assumes the custom pipe is like this:
Also see the official Angular guide: Using a pipe in a template.