import { Component , OnInit , ChangeDetectorRef , ChangeDetectionStrategy , } from "@angular/core" ; import { QueueNode , UploadQueueService , } from "src/app/services/upload-queue.service" ; import { Subscription } from "rxjs" ; @ Component ( { selector : "app-queue" , templateUrl : "./queue.component.html" , styleUrls : [ "./queue.component.scss" ] , changeDetection : ChangeDetectionStrategy . Default , } ) export class QueueComponent implements OnInit { uploadStatus : "uploading" | "uploaded" = "uploading" ; queue : Array < QueueNode < any > > = [ ] ; destroy : boolean = false ; isSuspend : boolean = false ; statusSub : Subscription = null ; alreadyUploadQueue : Array < QueueNode < any > > = [ ] ; constructor ( public uQueue , private ref ) { this . queue = uQueue . queue ; this . alreadyUploadQueue = uQueue . alreadyUploadQueue ; this . statusSub = uQueue . onChangeUploadStatus . subscribe ( ( res ) => { this . queue = uQueue . queue ; this . alreadyUploadQueue = uQueue . alreadyUploadQueue ; this . isSuspend = res ; } ) ; } close ( ) { this . uQueue . alreadyUpProgress = false ; } ngOnInit ( ) { } async upload ( ) { } segmentChanged ( e ) { } cancel ( ) { } ngDestroy ( ) { this . destroy = true ; this . statusSub . unsubscribe ( ) ; } }