The img src path in Ionic v1
im using ionic v1 and this is my folder structure.
www\tempaltes\acct\
in my acct folder , I have acct-home.html and patient_default.png
im trying to map my patient_default.png to acct-home using this code.
<img src="patient_default.png" alt="Test" width="100px" height="100px">
Please note that acct-home.html and patient_default.png are in the same folder. But it doesn't display correctly. Am I doing it wrong? Your help will be really appreciated.
Updated question:
this is my folder structure
root
--API
--patient_default.png
--Www
--templates
--acct
--acct-home.html
I tried to use
<img src="../../API/patient_default.png" alt="Test" width="100px" height="100px">
nothing is displayed.
source to share
With a type, src="patient_default.png"
you can only access if you are in the index or application initialization view ... But in your case, you need to access from subfolders. To do this, you need to provide the correct path to the src attribute, eg src="../your image containingfolder /logo.png"
. It's like going backwards.
And for your update
you need to grow ../
to that folder, for example, suppose if "../your image containingfolder /logo.png"
points in your www folder, you need to add another one, for example "../../your image containingfolder /logo.png"
to use them, but make sure they are available in that location
source to share