Angular4-从页面历史记录堆栈中删除页面引用

Raj*_*med 3 javascript angular2-routing angular

在我的角度Web应用程序中,需要从角度页面历史记录堆栈中删除页面引用。例如:我现在从登录页面导航到仪表板页面,应该从堆栈中删除登录页面引用。

在此处输入图片说明

Kun*_*vič 7

我认为您需要查看https://angular.io/api/router/NavigationExtras#replaceUrl

replaceUrl: true根据文档,您需要在导航至组件时通过:

Navigates while replacing the current state in history.

// Navigate to /view
this.router.navigate(['/view'], { replaceUrl: true });
Run Code Online (Sandbox Code Playgroud)