ffsw ffsw - 10 days ago 5
Javascript Question

using <img src in ember cli

I couldn't get a image showing up in ember cli. I tried to use the html img tag and made an exception into my environment file.

contentSecurityPolicy: {
'img-src': "'self' * all"
}



<img src="/public/images/image.png">


And I'm getting the following error message:
Failed to load resource: the server responded with a status of 404 (Not Found)

What I'm doing wrong?

Answer

Do not include the public directory when specifying the path.

Instead, just try the following:

<img src="images/image.png">

Comments