Bird
0
0

You want to create a custom pipe that formats a string by repeating it a given number of times. Which pipe transform method signature correctly accepts a parameter for the repeat count?

hard📝 Conceptual Q8 of 15
Angular - Pipes
You want to create a custom pipe that formats a string by repeating it a given number of times. Which pipe transform method signature correctly accepts a parameter for the repeat count?
Atransform(value: string, options: object): string
Btransform(value: string): string
Ctransform(value: string, ...args: any[]): string
Dtransform(value: string, count: number): string
Step-by-Step Solution
Solution:
  1. Step 1: Understand pipe transform method

    It receives the value and parameters as method arguments.
  2. Step 2: Match parameter for repeat count

    Method with value and count parameter matches requirement.
  3. Final Answer:

    transform(value: string, count: number): string -> Option D
  4. Quick Check:

    Transform method params = value + parameters [OK]
Quick Trick: Transform method params match pipe parameters [OK]
Common Mistakes:
  • Omitting parameter in transform method
  • Using rest parameters unnecessarily
  • Passing options object instead of direct params

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes