I want to use ngClass to add a class to an element if another element exists in the DOM.
<div id="element-a"
[ngClass]="{'my-class':(expression-to-check-if-#element-b-exists)}">
...
</div>
<div id="element-b">I'm here!</div>
Is this possible to do directly in the template, or do I need to something more complex in the component?