I need assistance with updating my 'filelistArray' array. It is currently being populated with duplicate items whenever content is available in the 'this.uploadCopy.queue' array, which happens multiple times.
However, I want to update the array only when there is unique content available in 'this.uploaCopy.queue', and avoid any duplicates.
Can someone kindly provide guidance on how to achieve this?
ngDoCheck() {
if (this.uploadCopy.queue !== undefined && this.uploadCopy.queue.length > 0) {
for (let entryitemlist of this.uploadCopy.queue) {
this.filelistArray.push(entryitemlist.file.name);
}
}
if (this.uploadCopy.queue == undefined && this.uploadCopy.queue.length == 0) {
this.filelistArray.length = 0;
}
}