因此,当我直接点击页面地址时,我试图理解 Angular 的路由/地址重写行为逻辑,即转到 index.html 的“/”。
(你可能会质疑我为什么要这样做。这是因为我试图在一个不寻常的上下文中使用 Angularjs,在这种情况下,直接通过其完整地址访问页面是不可避免的,当我这样做时,路由会变得很奇怪。)
//If I hit:
http://localhost/
//everything works fine all - address bar rewrites to http://localhost/#/authenticate
//window.location == http://localhost/
//If I hit:
http://localhost/index.html //I know, I know, I need to do it this way
//page address gets re-written as http://localhost/index.html#/index.html
//nothing works fine none of the routing happens
//window.location == http://localhost/index.html
有什么见解吗?