1
votes

I am working with the latest version of Ionic2 (2.0.0 final! ) , and I am facing issue with the location of my images in the app.

My images location is:

src\assets\img\

And in my html pages I am using the img tag like that:

<img src="img/do.png"/>

The images are loaded just fine when I'm running ionic serve.

But when I'm running "ionic run android" The images are not loaded and I am getting the error :

Failed to load resource: net::ERR_FILE_NOT_FOUND

file:///android_asset/www/img/do.png

1

1 Answers

0
votes

If the image is located in src\assets\img\do.png then in your html code you need to use this path: <img src="assets/img/do.png"/>