title: Get DOM element which is a component in Angular
body: <p>I read some answers already here, such as <a href="https://stackoverflow.com/questions/32693061/angular-2-typescript-get-hold-of-an-element-in-the-template">this</a>, 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.</p>
  
  <p>My HTML template contains component:</p>
  
  <p><code>&lt;sidenav-menu #sidenav class="app__sidenav"&gt;&lt;/sidenav-menu&gt;
  </code></p>
  
  <p>And my class contains a reference to it: </p>
  
  <pre><code>@ViewChild('sidenav') sidenav: ElementRef;
  </code></pre>
  
  <p>But when I log <code>this.sidenav</code> 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?</p>