-2

This is the project structure, generated from Angular cli.

Morvader
  • 2,317
  • 3
  • 31
  • 44
sumeeth
  • 93
  • 5
  • This is the error when i run the application(through ng serve).....GET http://localhost:4200/src/app/login.jpg 404 (Not Found) ....... – sumeeth Dec 05 '16 at 07:10
  • try to change the url path to `./login.jpg` and check. – micronyks Dec 05 '16 at 07:12
  • I changed to "background-image: url(./login.jpg);" then also it gives "GET http://localhost:4200/login.jpg 404 (Not Found)" this error. – sumeeth Dec 05 '16 at 07:20
  • Please don't just post a screenshot of your editor. Take the time to write out the problem, including relevant code and the error message you're getting. Your most likely problem is that your server is not configured to serve the `src/app/login.jpg` file, and that you need to add a route to your server for it. – ovangle Dec 05 '16 at 07:21
  • Take a look at http://stackoverflow.com/a/40748755/5357459 – adriancarriger Dec 05 '16 at 07:21

1 Answers1

-1

this error is coming because browser can not findout path to your image link.. try to change url to relative path.. and for best practice you should store images & assets in one separte folder you can call it public.

Amit kumar
  • 6,029
  • 6
  • 30
  • 40