I'm trying to extend a method from inside this Angular package.
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;
}
}
Inside of the FileUploader
class, this is the item I'm wanting to extend:
export declare class FileUploader {
...
onAfterAddingFile(fileItem: any): any;
}
I found this, 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 withCredentials
to false, as this flag should not be true for my current needs.