Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

How do you create a custom pipe?
A. Use @Injectable
B. Extend the Pipe class
C. Create a class implementing `PipeTransform` with @Pipe decorator
D. Create a function
Direction: Choose the correct option

Q2.

What method must a custom pipe implement?
A. convert
B. pipe
C. transform
D. execute
Direction: Choose the correct option

Q3.

Where should you declare a custom pipe?
A. In providers array
B. In a module's declarations array
C. In exports array
D. In imports array
Direction: Choose the correct option

Q4.

Can a pipe accept parameters?
A. Only through services
B. Yes, in the template: `{{ value | pipeName:param1:param2 }}`
C. Only one parameter
D. No, pipes cannot have parameters
Direction: Choose the correct option

Q5.

What is the purpose of the `pure` property in @Pipe?
A. Enables caching
B. Makes the pipe faster
C. Disables the pipe
D. Specifies whether the pipe is pure (stateless) or impure
Direction: Choose the correct option

Q6.

What is the difference between pure and impure pipes?
A. Pure pipes execute only when inputs change; impure on every change detection
B. No difference
C. Pure are faster
D. Impure are deprecated
Direction: Choose the correct option

Q7.

Can a custom pipe use dependency injection?
A. Yes, pipes can inject services
B. No, pipes cannot have dependencies
C. Only pure pipes
D. Only impure pipes
Direction: Choose the correct option

Q8.

What is the return type of the `transform` method?
A. Must be string
B. Must be array
C. Any type (based on pipe's purpose)
D. Must be number
Direction: Choose the correct option

Q9.

What is the `PipeTransform` interface?
A. An interface that defines the `transform` method
B. A pipe decorator
C. A pipe module
D. A pipe class
Direction: Choose the correct option

Q10.

How many parameters can the `transform` method have?
A. Maximum three
B. At least one (the value) plus any number of optional parameters
C. Only one