0
所以我試圖瞭解角度的路由/地址重寫行爲邏輯,當我直接打到頁面的地址,即去index.html只讀'/'。當我直接點擊頁面時,angular的路由如何重寫地址欄?
(你可能會質疑爲什麼我這樣做。它的,因爲我想使用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
任何見解?
對不起,我不完全清楚的問題,但如果你去這裏:view-source:http://code.angularjs.org/1.1.5/angular.js行7847它似乎有定義何時否則之後的路線提供者可能會有所幫助。 – shaunhusain