What is View Encapsulation
In Angular, component CSS styles are encapsulated into the component’s view an don’t affect the rest of the application.
View Encapsulation modes
These modes control how encapsulation happens on a per component basis:
How to set View Encapsulation
Use the encapsulation property in the component metadata:
encapsulation: ViewEncapsulation.ShadowDom
What is _nghost
An element that would be a shadow DOM host in native encapsulation has a generated _nghost attribute. This is typically the case for component host elements.
What is _ngcontent
An element within a component’s view has a _ngcontent attribute that identifies to which host’s emulated shadow DOM this element belongs.