How can I go directly to a state with ui-router without first navigating to index.html

后端 未结 2 1327
挽巷
挽巷 2021-01-19 22:23

I have an AngularJS application that is using ui-router. All is working okay but I would like to have a user registration confirmation screen accessed like this:

<         


        
2条回答
  •  死守一世寂寞
    2021-01-19 23:25

    It's quite simple actually, but requires work at server-side: the server must be configured to serve the index.html page for the path /Auth/confirmation (and for all the other bookmarkable URLs of your app).

    Once that is true, a user going to /Auth/confirmation will thus download the index.html file, which will start the angular application. The ui-router module will analyze the location, load the corresponding state, and display the corresponding view.

提交回复
热议问题