0

I created an angular app with 'ng new my-app', folder structure is like so:

my-app
  |- e2e
  |- node_modules
  |- src
     |- assets
         |- images
             |- smile.jpg

How can I reach my image through the client with http://localhost:4200/images/smile.jpg?

1 Answer 1

4

Try this way

If you want to open image from browser url then use this

http://localhost:4200/assets/images/smile.jpg

Image

Sign up to request clarification or add additional context in comments.

2 Comments

localhost:4200/assets/images/smile.jpg doesn't work. It just refers me back to localhost:4200
Make sure image name must be right other wise it will redirect to localhost:4200.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.