To define specific styles that apply only to a component and do not affect any external elements, you'd set the component's encapsulation property to ViewEncapsulation.______.

  • None
  • ShadowDom
  • Emulated
  • Native
In Angular, the encapsulation property determines how styles are scoped for a component. Setting it to Emulated (or None for no encapsulation) ensures that styles apply only to the component and its descendants, not affecting external elements. This is often used to create encapsulated styles for Angular components. The other options (ShadowDom and Native) represent different encapsulation methods, but Emulated is the correct option for this scenario.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *