1

My images won't show up on an Angular 2 app on Github Pages. I could see the images during the app's development, but now the relative link returns the error: Failed to Load Resource on inspection.

The image link from development looks like this:

/assets/images/juno.gif

I tried copying the path from repo, but the image still doesn't show

mybiography/src/assets/images/juno.gif

I also tried copying the github link to the image file, but my Angular CLI service redirects me back to the application's home page.

https://github.com/st4rgut22/mybiography/blob/master/src/assets/images/juno.gif

Please advise what I should do, here's the link to the page where the images fail to show upon dropdown selection: https://st4rgut22.github.io/mybiography/work

1 Answer 1

6

When using relative path just start src path with ./

Change src="/assets/images/rot.gif" to src="./assets/images/rot.gif"

N.B. ./ denotes the current location

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.