Image can not be loaded into the application

0

The image appears normal when running in the "ionic serve" but when I squeeze in a device ionic run android --device it can not be loaded, strange that I put an alt in the img tag and can only display the alt, nothing appears. My tag looks like this:

<img src="../assets/img/logomarcaSaf.png" class="logo" (click)="infor()">

What could be causing the image to load badly? I have another background that is much heavier and appears normally.

    
asked by anonymous 13.10.2017 / 22:21

1 answer

2

You should put the image straight from the assets folder, if I remember correctly.

Try this:

<img src="/assets/img/logomarcaSaf.png" class="logo" (click)="infor()">

or so:

<img src="assets/img/logomarcaSaf.png" class="logo" (click)="infor()">

When the ionic compiles the app it plays to the build folder and access is made by it, when using the ../ it loses the reference of the correct folder.

    
13.10.2017 / 22:52