bishoe nb

bishoe nb

  • 1k
  • 623
  • 78.2k

how can show images array from db using ngx-gallery

Jan 1 2020 4:39 PM
how can show images from db using ngx-gallery angular7 i try by this code but not work
 
Error GET https://localhost:44318/Resources/Images/this._PhotoT.imageNameTh 404
 
in console log show The Full object fine
  1. getdetails(id:number): Observable <Photo[]>  
  2. {return  
  3. this.http.get('https://localhost:44318/api/Albums/' + id).map((response: Response)=>  
  4. <Photo[]>response.json());} cOmponent_PhotoT : Photo[];images: GalleryItem[];ngOnInit(): void {this.Get();this.images = [new ImageItem({ src: 'https://localhost:44318/Resources/Images/''this._PhotoT.imageNameTh' }),// ... more items];//  
  5. this.images = [//  
  6. new ImageItem({ src: 'https://localhost:44318/Resources/Images/'+ //this._PhotoT.imageNameTh}),// ... more items// ];}  
  7.   
  8. Get(){let id : number = this._activeRoute.snapshot.params['PhotoId'];this._PhotosAlbumService.getdetails(id).retryWhen((err) =>  
  9. {return err.scan((retryCount) =>{retryCount +=1;}, 0).delay(1000)  
  10. })//  
  11. .subscribe((PhotoAlbum) => {  
  12. if(PhotoAlbum == null){  
  13. this.statusMessage = ' does not exist';  
  14. else {  
  15. this._PhotoT= PhotoAlbum  
  16. console.log (this._PhotoT);}},  
  17. (error) =>{  
  18. this.statusMessage = "please try again after sometime"  
  19. console.log(error);  
  20. })}  
<gallery [items]="images"></gallery>

Answers (4)