救救我!!!!
upload.ts
fetchPhotos() {
this.photoLibrary.requestAuthorization().then(() => {
this.photoLibrary.getLibrary().subscribe({
next: library => {
this.photos = library;
this.cd.detectChanges();
// console.log(this.library[0].thumbnailURL)
//this.tempImagePath = normalizeURL(imagePath);
},
error: err => { },
complete: () => { console.log("could not get photos"); }
});
}).catch(err => console.log("permissions weren't granted"));
}
upload.html
<div class='photos' *ngIf='photos'>
<div class='photo' *ngFor='let photo of photos;'>
<img [src]="photo.photoURL" alt="{{photo.fileName}}"><br>
{{ photo.photoURL }}
</div>
</div>
离子信息
https://hizliresim.com/LlbaLo
屏幕 https://i.hizliresim.com/Gm9YVr.jpg
İf错误= [src] =“ photo.photoURL | cdvphotolibrary”
<div class='photos' *ngIf='photos'>
<div class='photo' *ngFor='let photo of photos;'>
<img [src]="photo.photoURL | cdvphotolibrary" alt="{{photo.fileName}}"><br>
{{ photo.photoURL }}
</div>
</div>