title: Calling Typescript function from html2canvas in angular 2
body: <p>I am using html2canvas in angular 2 to capture the webpage but i need to send the string image to the server side using a webapi post call</p>
  
  <pre><code>imageDownload() {
      html2canvas(document.body).then(function (canvas) {
          var imgData = canvas.toDataURL("image/png");
          document.body.appendChild(canvas);
      });
  }
  </code></pre>
  
  <p>I am unable to access this typescript function from html2canvas,how can i access this method to send the image string to the server side</p>
  
  <pre><code>AddImagesResource(image: any) {
      this.imagesService.addCanvasResource(image)
          .subscribe(response =&gt; {
              this.eventsEmitter.broadcast('Success', 'Changes Saved Succesfully');
          },
          error =&gt; {
              this.eventsEmitter.broadcast('Error', 'Error Occured');
          });
  }
  </code></pre>