https://i.sstatic.net/04cws.pngI have a list of image names that contain UUIDs.
images
[
"auditid_626_UUID_666666_time__1582577405550.jpg",
"auditid_626_UUID_999999_time__1582577405554.jpg",
"auditid_626_UUID_999999_time__1582577405557.jpg"
]
These images are being displayed on an HTML page using the following code:
<ion-list>
<ion-item *ngFor="let img of images; index as pos" class="ion-text-wrap">
<ion-thumbnail slot="start">
<ion-img [src]="img.path"></ion-img>
</ion-thumbnail>
<ion-textarea auto-grow="true">{{ img.name }}</ion-textarea>
<ion-button slot="end" fill="clear" (click)="startUpload(img)">
<ion-icon slot="icon-only" src="assets/upload.svg"></ion-icon>
</ion-button>
<ion-button slot="end" fill="clear" (click)="deleteImage(img, pos)">
<ion-icon slot="icon-only" name="trash"></ion-icon>
</ion-button>
</ion-item>
</ion-list>
The method used to fetch and filter this array is shown below:
ngOnInit() {
this.testID = "666666";
}
loadStoredImages() {
this.storage.get(this.STORAGE_KEY).then(images => {
if (images) {
let arr = JSON.parse(images);
this.images = [];
for (let img of arr) {
let filePath = this.file.dataDirectory + img;
let resPath = this.pathForImage(filePath);
this.images.push({ name: img, path: resPath, filePath: filePath });
}
}
});
}
The goal is to filter the array to only include the UUIDs that match
this.testID = "666666";
. Assistance is needed on applying this filter. Thank you!
image from xcode log