On this page
ViewEncapsulation
enum
| npm Package | @angular/core | 
|---|---|
| Module | import { ViewEncapsulation } from '@angular/core'; | 
     
| Source | core/src/metadata/view.ts | 
Overview
enum ViewEncapsulation {
  Emulated: 0
  Native: 1
  None: 2
}
  Members
Emulated: 0
  Emulate Native scoping of styles by adding an attribute containing surrogate id to the Host Element and pre-processing the style rules provided via styles or styleUrls, and adding the new Host Element attribute to all selectors.
This is the default option.
Native: 1
  Use the native encapsulation mechanism of the renderer.
For the DOM this means using Shadow DOM and creating a ShadowRoot for Component's Host Element.
None: 2
  Don't provide any template or style encapsulation.
© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
 https://v5.angular.io/api/core/ViewEncapsulation