title: How to add/remove class from directive
body: <p>Using a custom directive how would you add/remove a class on the host element based on a specific conditions?</p>
  
  <p><strong>Example:</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>@Directive({
    selector: '[customDirective]'
  })
  export class CustomDirective {
    constructor(service: SomService) {
      // code to add class
  
      if (service.someCondition()) {
          // code to remove class
      }
    }
  }
  </code></pre>