有沒有什麼方法可以使用角度靜默地更改url欄中的路線?
用戶點擊一個鏈接,就是那張在電子郵件至:
/verificationExecuted?verificationCode=xxxxxx
頁面加載時我想讀的verificationCode然後將其清除:當我明確
if($location.path() == '/verificationExecuted'){
this.registrationCode = this.$location.search()["verificationCode"];
this.$location.search("verificationCode", null); //Uncomment but make this silent!
if(registrationCode != null) {
....
}
else $location.path("/404");
}
會發生什麼它是路線的其餘部分(「/ verificationExecuted」)仍然是路線重新觸發,所以它再次繞過沒有驗證碼並直接到達404。
我想刪除代碼而不做其他任何事情。
這將刷新路線 – WrksOnMyMachine