title: How to set attributes on an element in Angular 2?
body: <p>I have a simple <code>Directive</code> as follows:</p>
  
  <pre><code>import { Directive, OnInit, OnDestroy, ElementRef } from "@angular/core";
  
  @Directive({
      selector: "[Checker]"
  })
  export class Checker {
  
      constructor(private e: ElementRef) {
  
      }
  
      OnInit() {
          this.e.nativeElement.setAttribute("spellcheck", "true");
      }
  
      keyFunc(event: KeyboardEvent) {
          if (event.keyCode == 74) {
              //more functionality
          }
      }
  
  }
  </code></pre>
  
  <p>So, whenever I add this directive selector to any tag, I set the <code>spellcheck</code> attribute to <code>true</code>. </p>
  
  <p>How can I set this attribute in an Angular2 way, i.e. what is the alternative Angular way to do this?</p>