Bird
0
0

Why does Angular use ViewEncapsulation.Emulated as the default instead of ShadowDom?

hard📝 Conceptual Q10 of 15
Angular - Components
Why does Angular use ViewEncapsulation.Emulated as the default instead of ShadowDom?
ABecause ShadowDom is deprecated and no longer supported
BBecause Emulated works consistently across all browsers without native shadow DOM support
CBecause Emulated disables style encapsulation for global styles
DBecause ShadowDom requires manual style scoping
Step-by-Step Solution
Solution:
  1. Step 1: Understand browser support for Shadow DOM

    Not all browsers fully support native shadow DOM, so Emulated ensures compatibility.
  2. Step 2: Clarify misconceptions about ShadowDom and Emulated

    ShadowDom is not deprecated; Emulated scopes styles by adding attributes, not disabling encapsulation.
  3. Final Answer:

    Because Emulated works consistently across all browsers without native shadow DOM support -> Option B
  4. Quick Check:

    Default Emulated = cross-browser compatibility [OK]
Quick Trick: Emulated ensures style scoping on all browsers [OK]
Common Mistakes:
  • Thinking ShadowDom is deprecated
  • Believing Emulated disables encapsulation
  • Assuming ShadowDom needs manual scoping

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes