Sherwyn Goh
Sherwyn Goh

Reputation: 1352

How do I access and display images from an ionic app?

I'm having issues with displaying images after running

ionic run ios

I have the default ionicframework template running with the sidemenu, and have not changed the app directory structure at all.

I have an inline css to specify a background image from an ng-repeat directive for categories.

style='background: url("{{category.img}}")

I've tried ../img/picture.jpg, /img/picture.jpg and img/picture.jpg. None seem to work. Please help!

Thanks in advance

Upvotes: 1

Views: 1742

Answers (1)

Rasalom
Rasalom

Reputation: 3111

I had the same issue, my project structure look like this:

/www/
    /images/
    /views/page.html
    index.html

and in page.html img links was: <img src="images/image.png" ../> and it worked for both web and mobile build.

Hope this helps.

Upvotes: 7

Related Questions