How to access and display images from an ionic application?

I'm having problems displaying images after starting

ionic run ios 

I have a default icon template that works with sidemenu and has not changed the directory structure of the application at all.

I have built-in css to specify the background image from the ng-repeat directive for categories.

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

I tried ../img/picture.jpg,/img/picture.jpg and img / picture.jpg. Nobody seems to be working. Please, help!

Thanks in advance

+1
source share
1 answer

I had the same problem, my project structure looks like this:

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

and in page.html img links were: <img src="images/image.png" ../> , and it worked for both network and mobile builds.

Hope this helps.

+7
source

Source: https://habr.com/ru/post/1209079/


All Articles