Posts

Showing posts from September, 2020

Viewencapsulation in Angular

Image
  Hello Readers, In this article, we will see what actually view encapsulation is? How it is working? What are the types of view encapsulation available in angular? What is Shadow DOM? Does angular application support the scope for styling, even though the browser doesn’t support shadow DOM? We will see this entire list of questions in details one by one! So to start with, let me explain you the use case, say for example we had two components 1. app. component ( parent component) 2. demo. component( child component) We will be using the demo component inside the app component, all right! Now furthermore we had an h1 selector on both the components to display title, and as view encapsulation works with styling, we had created a style in app component for the selector h1. Now as we are calling the demo component inside the app component and demo component also had an h1 selector. What happened then? Does that style which we created on app component should automatically be applied to ...