【发布时间】:2021-08-14 13:34:31
【问题描述】:
在我成功填写表单并重定向到 Angular 中的另一个页面后,我正在尝试找到一种弹出消息或警报的方法
导航后出现“新表单添加成功”之类的内容
这是我的根目录导航代码
specialEvents = []
constructor( private _eventService: EventService,
private _router: Router) { }
ngOnInit(): void {
this._eventService.getSpecialEvents()
.subscribe(
res => this.specialEvents = res,
err => {
if( err instanceof HttpErrorResponse ) {
if (err.status === 401) {
this._router.navigate(['/home'])
}
}
}
)
}
谁能告诉我如何在 this._router.navigate(['/home'])
之后显示弹出窗口或成功警报【问题讨论】:
标签: angular typescript bootstrap-4