我必须在我的角度应用程序中重新加载页面才能重置我的所有数据。
但是,当我做window.location.reload()
我有一个白色屏幕时,用户可以认为应用程序崩溃。所以我想要cursor:wait
但它不起作用。
.ts文件:
ngOnInit() {
document.body.style.cursor = "wait";
}
ngAfterViewInit() {
document.body.style.cursor = "initial";
}
有人有任何解决方案吗?
我不确定重新加载整个应用程序是否理想。您只需重新加载组件即可更新组件和视图。
constructor(private route : ActivatedRoute,
private router : Router) {}
buttonClick() {
this.router.navigateByUrl('your_path');
}
希望这有帮助!