Angular $location not updating when browser back is used

后端 未结 1 1883
忘掉有多难
忘掉有多难 2021-01-25 08:02

Has anyone run across this behaviour? There isn\'t much mentioned about it, and the other posts are different in nature. This appears to be inconsistent w/ documentation about b

相关标签:
1条回答
  • 2021-01-25 08:20

    How I solved this:

    var pop = 0;
    
    window.onpopstate = function(event) {
        if (document.location.pathname === '/' && pop > 1) {
            pop = 0;
            document.location = 'http://localhost:9000/';
        }
        pop++;
    };
    
    0 讨论(0)
提交回复
热议问题