Angular 2 routing and direct access to a specific route : how to configure Apache?

孤街醉人 提交于 2019-11-30 06:44:53
Ludovic Pénet

ok, so everything was fine excepted the fact that the dynamically generated base href was wrong.

Thanks to @günter-zöchbauer for pointing Angular 2.0 router not working on reloading the browser

In my original code, it is generated from document.location :

<script>document.write('<base href="' + document.location + '" />');</script>

If I switch to a static element :

<base href="/angular2-sens/"/>

It works. Of course, I will rather further analyse document.location in a "real" app.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!