What is view encapsulation in Angular?

View encapsulation defines whether the template and styles defined within the component can affect the whole application or vice versa. Angular provides three encapsulation strategies:

  1. Emulated – styles from the main HTML propagate to the component.
  2. Native – styles from the main HTML do not propagate to the component. 
  3. None – styles from the component propagate back to the main HTML and therefore are visible to all components on the page.

Comments

Leave a Reply

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