AngularJS: How to remove current view url from window.history?

后端 未结 1 735
闹比i
闹比i 2021-01-12 03:17

I have #/load-data view with spinner. When data load is complete controller redirects to differen view $location.path(\'/show-info/\'). How to rem

相关标签:
1条回答
  • 2021-01-12 03:57

    You could use the $location.replace() method to replace the last history entry.

    Here is the link to the documentation.

    So when you are showing the spinner, you could switch to the actual view show-info with the following lines:

    $location.path('/show-info/');
    $location.replace();
    

    Or shorter:

    $location.path('/show-info/').replace();
    
    0 讨论(0)
提交回复
热议问题