【发布时间】:2020-01-15 15:40:16
【问题描述】:
我正在使用 Angular 8 开发 NativeScript 6 项目。
我想在用户登录后清除路由器历史记录。
这是我尝试过的:
公共登录() {
this.registerUserCredentialsService
.registerUserCredentials(this.username, this.password)
.then(() => {
this.router.navigate(['home-page'], { clearHistory: true });
});
}
我不断收到此错误:
ERROR in src/app/register-user-credentials.component.ts(33,55): error TS2345: Argument of type '{ clearHistory: boolean; }' is not assignable to parameter of type 'NavigationExtras'.
Object literal may only specify known properties, and 'clearHistory' does not exist in type 'NavigationExtras'.
How can I clear the router history?
【问题讨论】:
标签: angular nativescript router