routing and clean path (no hashtag) not working in angularJS

后端 未结 3 894
[愿得一人]
[愿得一人] 2021-01-21 22:57

Guys this is driving me crazy, been fighting for hours on this, and couldn\'t find a solution!

I know that in order to clean the hashtag from the URL path, i need to use

3条回答
  •  滥情空心
    2021-01-21 23:24

    I haven't tried myself yet, but from what I know, you have to make sure that your server simply returns your initial HTML page for these non-existing URLs. Then when the page will reload, an onload event will be fired and you can access the last state via history.state. I guess angular will just restore the state automatically so you shouldn't have to worry about this.

提交回复
热议问题