Images into .ts don't show properly into APK


#1

Hi :slightly_smiling_face: In my app I have an <ion-slide> with 3 slides, each has the “image” field. The images are displayed correctly on the browser, but in the apk I can’t see them.
My images are into the .ts file, I tried different path (like you can see from the code) but none of it worked.
How can I show images from a .ts file so that they are seen correctly into the apk? I found solutions only for html and css code.

I have my images into src/assets/img

     this.slidess = [
      {
        title: "title 1",
        description: "description 1",
        image: '../src/assets/img/loc.png',
      },
      {
        title: "title 2",
        description: "description 2",
        image: '/assets/img/trip.png', 
      },
      {
        title: "title 3",
        description: "description 3",
        image: '../assets/img/edit.png', 
      }
    ]; 
  }

Tell me if more code is needed!

Thank you in advance!


#2

Try using just ‘assets/img/loc.png’ without leading ‘/’ or ‘…/’.


#3

i am accessing the url image from one site url:htt;/hypo/site/…/.pjpg" it is working on browser its not runing on amultor can u help me