How to Resolve: TypeError: Cannot convert undefined or null to object
<p>I am creating an angular2 project and I am using ng2-uploader as the plugin for file upload. I want to drag and drop on a div and at the same time I want an upload button inside the div. After selecting a file to upload I got the error as 
<strong>TypeError: Cannot convert undefined or null to object</strong>.</p>

<p><strong>Html code is:</strong> </p>

<pre><code>&lt;div [hidden]="!onUpload" ngFileDrop [options]="options" (onUpload)="handleUpload($event)" [ngClass]="{'file-over': hasBaseDropZoneOver}" (onFileOver)="fileOverBase($event)"&gt;
     &lt;input type="file" ngFileSelect [options]="options" (onUpload)="handleUpload($event)"&gt;
     &lt;p&gt;&lt;span&gt;Response: {{ uploadFile | json }}&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
</code></pre>

<p><strong>Component is:</strong></p>

<pre><code>import { Component, OnInit, NgModule, NgZone } from '@angular/core';

@Component({
  selector: 'app-fileselect',
  templateUrl: './fileselect.component.html',
  styleUrls: ['./fileselect.component.css']
})

export class FileSelectComponent implements OnInit {
  zone: NgZone;
  hasBaseDropZoneOver: boolean = false;
  basicProgress: number = 0;
  uploadFile: any;

constructor() {
    this.zone = new NgZone({ enableLongStackTrace: false });//file upload    
  }

options: Object = {
    url: 'http://localhost:4200/assets/documents'
  };

handleUpload(data): void {
    if (data &amp;&amp; data.response) {
      data = JSON.parse(data.response);
      this.uploadFile = data;
      this.zone.run(() =&gt; {
        this.basicProgress = data.progress.percent;
      });
    }
  } 

fileOverBase(e: any): void {
        this.hasBaseDropZoneOver = e;
      }
    }
</code></pre>