title: native element is cannot access correctly in in angular 5
body: <p>I have a problem like this. I am making report generation part in angular 5 using jsPdf. This is my component.html file part.</p>
  
  <pre><code>&lt;div class="content-wrapper"&gt;
    &lt;div class="container-fluid"&gt;
  
      &lt;div id="content"&gt;
        &lt;h1&gt;My First PDF&lt;/h1&gt;
        &lt;p&gt;Hello Welcome To Easy Lab Reservation System&lt;/p&gt;
      &lt;/div&gt;
      &lt;button (click)="downloadPdf()" class="btn btn-info"&gt;Create Report&lt;/button&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>This my component.ts file.</p>
  
  <pre><code>import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
  import * as JSPDF from 'jspdf';
  
  @Component({
    selector: 'app-report',
    templateUrl: './report.component.html',
    styleUrls: ['./report.component.css']
  })
  export class ReportComponent implements OnInit {
  
    @ViewChild('content') content: ElementRef;
  
    constructor() { }
  
    ngOnInit() {
    }
  
    downloadPdf(){
      const doc = new JSPDF();
      let specialElementHandlers = {
        '#editor' : function(elemnt, renderer){
          return true;
        }
      };
  
      let content = this.content.nativeElement;
  
      doc.fromHTML(content.innerHtml,10,10,{
          'width': 190,
          'elementHandlers': specialElementHandlers
  
      });
      doc.save('MyFirst.pdf');
  
  
    }
  
  }
  </code></pre>
  
  <p>When I hit on Create report button. It gives me an error like this.</p>
  
  <pre><code>ERROR TypeError: Cannot read property 'nativeElement' of undefined
      at ReportComponent.downloadPdf (report.component.ts:26)
      at Object.eval [as handleEvent] (ReportComponent.html:113)
      at handleEvent (core.js:13589)
      at callWithDebugContext (core.js:15098)
      at Object.debugHandleEvent [as handleEvent] (core.js:14685)
      at dispatchEvent (core.js:10004)
      at eval (core.js:10629)
      at HTMLButtonElement.eval (platform-browser.js:2628)
      at ZoneDelegate.invokeTask (zone.js:421)
      at Object.onInvokeTask (core.js:4751)
  </code></pre>
  
  <p>I search lots of time to find out a solution to this problem. But Those were not enough to full fill my requirement. Can someone help me solve this issue with my code?. And I want to get to know </p>
  
  <pre><code>let specialElementHandlers = {
            '#editor' : function(elemnt, renderer){
              return true;
            }
          };
  </code></pre>
  
  <p>what this code part do in here?</p>
  
  <p>Thank You!!</p>