When we have this part of code:
<div *ngFor="element of elements1" class="element"></div>
<div *ngFor="element of elements2" class="element"></div>
And class Element:
.element {
color:red;
}
.element:first-of-type {
color:blue;
}
And we have two cases:
The first one is when the class
element
is global. In this case just the first element ofelements1
will be blueThe second one is when the class "element" is local. In this case fist elements of both of the arrays will be blue
Why behavior in both cases isn't the same?