title: Angular 2, Extending a class
body: <p>I'm trying to extend a method from inside <a href="https://github.com/valor-software/ng2-file-upload" rel="nofollow noreferrer">this</a> Angular package.</p>
  
  <pre><code>import { Component, OnInit, Injectable  } from '@angular/core';
  import { FILE_UPLOAD_DIRECTIVES, FileUploader } from 'ng2-file-upload';
  
  @Injectable()
  export class FileUploadComponent extends FileUploader {
  
    constructor(public _myService: MyService) {
      super(arguments);
     }
  
    onAfterAddingFile(file: any) {
      file.withCredentials = false;
    }
  }
  </code></pre>
  
  <p>Inside of the <code>FileUploader</code> class, this is the item I'm wanting to extend:</p>
  
  <pre><code>export declare class FileUploader {
    ...
    onAfterAddingFile(fileItem: any): any;
  }
  </code></pre>
  
  <p>I found <a href="https://github.com/valor-software/ng2-file-upload/issues/140" rel="nofollow noreferrer">this</a>, but I can't seem to get it to work. I'm needing to extend that class so that when a file is added to the FileUploader, it sets <code>withCredentials</code> to false, as this flag should not be true for my current needs.</p>