Why pipes are considered safe in a template, but regular function calls (not signals) are not?
TechnicalAngular DeveloperSenior Angular DeveloperFrontend Angular developerPipes are considered safe in templates because they are pure functions that take input and return output without side effects. This ensures that they can be reused and tested easily. In contrast, regular function calls can introduce side effects and dependencies that may lead to unpredictable behavior in the UI.
Additionally, pipes are optimized by Angular's change detection, which enhances performance by only recalculating when the input changes, unlike regular function calls that run on every change detection cycle.