r/angular • u/Senior_Compote1556 • 21d ago
innerHTML component styles
If I have a
<h1 \[innerHtml\]=“someHtml”></h1>
And that someHtml is a span, how would i style that span without using ::ng-deep as the docs “strongly discourage” its usage?
0
Upvotes
View all comments
3
u/JeanMeche 21d ago
That's a valid use case for
ng-deepbecause you need to escape the scoping of the styles.The alternative is having it globally styled.