title: Register a custom HTML element in TypeScript - Ionic 2
body: <p>I created a component (directive) in TypeScript for <strong>Ionic 2</strong>, the component as a selector <code>&lt;search-result&gt;</code> and as we work with semantic HTML and we also style following HTML semantics, I would like to register this HTML element.</p>
  
  <p>I'm using TypeScript and I've already tried <code>document.registerElement</code> but it says that document does not exist on type 'Document'.</p>
  
  <p>That is my code:</p>
  
  <pre><code>import {Component, Input} from "@angular/core";
  import {NavController, NavParams} from "ionic-angular";
  import {IONIC_DIRECTIVES} from "ionic-angular";
  
  @Component({
      selector: "search-result",
      directives: [IONIC_DIRECTIVES],
      templateUrl: "build/pages/components/search-result/search.result.html"
  })
  export class SearchResultComponent {
      constructor() {
          document.registerElement("search-result");
      }
  }
  </code></pre>
  
  <p>Here is the error message in code:</p>
  
  <p><a href="https://i.stack.imgur.com/hB1t3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hB1t3.png" alt="enter image description here"></a></p>
  
  <p>How do I register an element? Am I missing a <code>import</code>?</p>