Bird
0
0

Why might you choose to use standalone pipes and directives instead of declaring them in NgModules in Angular?

hard📝 Conceptual Q10 of 15
Angular - Standalone Components
Why might you choose to use standalone pipes and directives instead of declaring them in NgModules in Angular?
ATo simplify imports and reduce NgModule boilerplate
BBecause standalone pipes run faster at runtime
CTo avoid writing any decorators on classes
DBecause standalone directives cannot be used in lazy-loaded modules
Step-by-Step Solution
Solution:
  1. Step 1: Understand the motivation for standalone

    Standalone pipes and directives reduce the need to declare them inside NgModules, simplifying imports and module setup.
  2. Step 2: Evaluate other options

    Standalone does not inherently improve runtime speed, decorators are still required, and standalone directives can be used in lazy-loaded modules.
  3. Final Answer:

    To simplify imports and reduce NgModule boilerplate -> Option A
  4. Quick Check:

    Standalone reduces NgModule complexity [OK]
Quick Trick: Standalone reduces NgModule declarations and imports [OK]
Common Mistakes:
  • Assuming standalone improves runtime speed
  • Thinking decorators are optional
  • Believing standalone can't be used in lazy modules

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes