Images in ionic 2


how i cann add images to the template of component, and wich the right directory to putting the images, and if i can creat sperate directory where is the right plase?



you can create a new folder “images” within your projects “www” directory, where you put all your template images.
Then your can write <img src="images/my-image.png"> in your component template to display them.

1 Like

@muhammedmoussa First, create a new folder “images” within your projects “www” directory.

When your image is located in www/images
– then you should reference it as images/logo.png from your HTML files
– or as ../../images/logo.png from your SCSS files.

this worked properly on my iPad and iPhone5. Try this one…this will work on both ionic serve and real devices

Refer below forum answer by one of the ionic team member for reference:

1 Like