2

I wanted to connect versitka to my angular component. I placed the version HTML file, my component in the html file and placed the image, css code, bootstrap code, js code in the assets file and gave a link to it.

Now everything seems to be fine, but when I run ng serve, only the html file works, css and images cannot be imported.

but if I make my html component goto live vs. code, it works. I don't understand why it doesn't work if I use Angular itself with ng serve?

it is worling goto live server 127.0.0.1 localhost but not vorking ng serve localhost 4200 - port why

I have tried to find a solution in many places but I can't find it

Mike Szyndel
  • 10,461
  • 10
  • 47
  • 63

1 Answers1

0

I think you are using a different base href or deploy URL than the default one. If you are using ng build --base-href="/.../" --deploy-url="/.../", you need to make sure that your assets are accessible from those paths. For example, if your base href is /my-app/ and your deploy URL is /my-app/, then your image should be located at /my-app/assets/images/paladin.jpg on your server

Dourado
  • 110
  • 8
yuski
  • 1
  • 2