Bird
0
0

You have a custom pipe marked as pure, but it still recalculates on every change detection. What is the most likely cause?

medium📝 Debug Q14 of 15
Angular - Pipes
You have a custom pipe marked as pure, but it still recalculates on every change detection. What is the most likely cause?
AThe pipe input is a new object or array instance each time.
BThe pipe is missing the @Pipe decorator.
CAngular does not support pure pipes.
DThe pipe class is not exported.
Step-by-Step Solution
Solution:
  1. Step 1: Recall pure pipe trigger condition

    Pure pipes run only when their input reference changes.
  2. Step 2: Identify cause of repeated recalculation

    If the input is a new object or array instance each time, the reference changes, triggering the pipe.
  3. Final Answer:

    The pipe input is a new object or array instance each time. -> Option A
  4. Quick Check:

    New input reference triggers pure pipe [OK]
Quick Trick: Check if input object/array is recreated each time [OK]
Common Mistakes:
  • Assuming pure pipes run without input changes
  • Thinking missing decorator causes recalculation
  • Believing Angular lacks pure pipe support

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes