constructor(
private router: Router,
private route: ActivatedRoute,
) {
}
if (event instanceof NavigationEnd) {
if (this.route.snapshot.queryParams.id) {
this.queryList.FileId = this.route.snapshot.queryParams.id;
this.queryList.Offset = 0;
}
}
this.router.navigate(['home/document/pulicDoc'], {queryParams: {id: res}});
this.isDocument = this.router.events.subscribe((event: Event) => {
if (event instanceof NavigationEnd) {
this.fileActive = event.url.indexOf('pulicDoc') >= 0 || event.url.indexOf('proDoc') >= 0;
}
});
this.unSpace = this.userSpaceService.spaceChange$.subscribe(res => {
this.getUserInfO();
});
}
ngOnDestroy() {
this.unSpace.unsubscribe();
if(this.isDocument) {
this.isDocument.unsubscribe();
}
}
来源:CSDN
作者:saturday-yh
链接:https://blog.csdn.net/qq_42092177/article/details/103478874