import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; //Interface import { IFileConfig } from '../components/ca-upload-dropzone/interfaces'; @Injectable({ providedIn: 'root', }) export class CaUploadFileService { private uploadDocumentsSubject: Subject<{ files: IFileConfig[]; action: string; }> = new Subject<{ files: IFileConfig[]; action: string }>(); private visibilityDropZoneSubject: Subject = new Subject(); get visibilityDropZone$() { return this.visibilityDropZoneSubject.asObservable(); } public visibilityDropZone(action: boolean) { this.visibilityDropZoneSubject.next(action); } get uploadedFiles$() { return this.uploadDocumentsSubject.asObservable(); } public uploadFiles(data: { files: IFileConfig[]; action: string }) { this.uploadDocumentsSubject.next(data); } }