Bird
0
0

Which decorator is used to define a custom pipe in Angular?

easy📝 Conceptual Q2 of 15
Angular - Pipes
Which decorator is used to define a custom pipe in Angular?
A@Pipe
B@Component
C@Injectable
D@Directive
Step-by-Step Solution
Solution:
  1. Step 1: Recall Angular decorators for different features

    @Component is for components, @Directive for directives, @Injectable for services.
  2. Step 2: Identify the decorator for pipes

    @Pipe decorator is specifically used to define custom pipes.
  3. Final Answer:

    @Pipe -> Option A
  4. Quick Check:

    Decorator for pipes = @Pipe [OK]
Quick Trick: Use @Pipe decorator to create custom pipes [OK]
Common Mistakes:
  • Using @Component instead of @Pipe
  • Confusing @Injectable with @Pipe
  • Using @Directive for pipes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes