Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: Explain Angular ViewEncapsulation and its types.
Answer: ViewEncapsulation is an Angular feature that determines how styles are applied to components. It has three types: Emulated (default), Native, and None. Emulated encapsulation uses shadow DOM emulation, Native uses the browser's native shadow DOM, and None applies styles globally.

Example:

@Component({
  selector: 'app-root',
  template: '

Hello World

',
  styleUrls: ['./app.component.css'],
  encapsulation: ViewEncapsulation.Emulated
})
Is it helpful? Yes No

Most helpful rated by users:

©2026 WithoutBook