I am attempting to enhance a method within the Angular package available at this link.
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;
}
}
My objective is to extend the following item inside the FileUploader
class:
export declare class FileUploader {
...
onAfterAddingFile(fileItem: any): any;
}
I came across this resource, but unfortunately, I have been unable to make it function as intended. The requirement is for me to modify that class so that when a file is added to the FileUploader, it automatically sets withCredentials
to false, as this setting does not align with my current requirements.