79625543

Date: 2025-05-16 16:00:49
Score: 0.5
Natty:
Report link

This is a perfect scenario to introduce a Custom Pipe.

https://angular.dev/guide/templates/pipes

Pipes are useful when you need to call a function from a template. The main advantage is Pipes are memoized, meaning they only recalculate when the input value changes.

Otherwise, it's likely your function will be called every change-detection cycle. Gross!

Just import the pipe into multiple different components to reuse the logic.

Reasons:
  • No code block (0.5):
Posted by: RyanSand20