I hosted my Angular2 application in IIS, I have three components in my application. The first component is loading perfect, but remaining components are not loading properly. My Application launching URL is
(loading assets properly). When I am routing to another component on a button click I am referring the same Image which is located in assets folder, which is not loading properly. I found the root cause for it, but I don't know how to solve it. The reason is on button click it will redirect to
localhost/UI/log/Project02 (I could not add https:// as it is not allowing more than 2 links)
and localhost(in server) is looking the assets folder like this localhost/UI/log/assets/logo.png instead of localhost/UI/assets/logo.png. The same image is loaded in first component but not in second component why? I tried by changing base href="/" in index.html also.
My second problem is, On a button click I am routing to 3rd component it is taking as localhost/UI/log/logdetails/2 instead of localhost/UI/logdetails/2
Can anyone help me on this?
This is Html code for referring the logo
<a href="#"><img src="assets/logo.png" alt=""></a> <span class="header-txt">Log</span>
<img src="/UI/assets/logo.png" alt="">