I read some answers already here, such as this, but my problem is slightly different. I want to get component as a DOM element so that I can add/remove some CSS classes on it.
My HTML template contains component:
<sidenav-menu #sidenav class="app__sidenav"></sidenav-menu>
And my class contains a reference to it:
@ViewChild('sidenav') sidenav: ElementRef;
But when I log this.sidenav
in one of my functions, I see that it is a representation of a class of Sidenav component, not its DOM representation. Why is that happening?