.parent {
color: blue;
}
.parent * {
color: red;
}
.child {
color: black;
}
.grandchild {
color: green;
}
<div class="parent">
Parent
<div>Child
<div>GrandChild</div>
</div>
</div>
Imagine a scenario where a property named toggle exists in an Angular component. The goal is to switch the ".parent *" style for its descendants, alternating their color between red and blue based on the toggle state. Is there a way to achieve this using ngClass or ngStyle? If so, could you please provide instructions? Much appreciated!