title: Change element class on ViewChild in Angular 2
body: <p>I am using ViewChild in Angular 2 to isolate an element. I can directly manipulate the styles but I cannot find documentation on if it is possible to change the elements style class.</p>
  
  <p>This is sample code:</p>
  
  <pre><code>    export class HomeComponent implements OnInit {
  
      @ViewChild('slideBg') el:ElementRef;
  
      ngAfterViewInit {
          // style can be changed
          this.el.nativeElement.style.background = 'red';
          // does not work:
          this.el.nativeElement.class = 'myCSSclass';
      }
  
      …
  
  }
  </code></pre>
  
  <p>Looking to see if this is possible and how. Any help appreciated.</p>