Revision 59816
Added by Argiro Kokogiannaki over 3 years ago
myClaims.component.ts | ||
---|---|---|
1 | 1 |
import {Component, Input} from '@angular/core'; |
2 |
import {Meta, Title} from '@angular/platform-browser'; |
|
3 | 2 |
import {User} from "../../login/utils/helper.class"; |
4 | 3 |
import {UserManagementService} from "../../services/user-management.service"; |
5 | 4 |
import {LoginErrorCodes} from "../../login/utils/guardHelper.class"; |
6 | 5 |
import {Router} from "@angular/router"; |
6 |
import {Subscriber} from "rxjs"; |
|
7 | 7 |
|
8 | 8 |
@Component({ |
9 | 9 |
selector: 'my-claims', |
... | ... | |
42 | 42 |
|
43 | 43 |
constructor(private userManagementService: UserManagementService, private _router: Router) {} |
44 | 44 |
|
45 |
sub; |
|
46 |
ngOnDestroy() { |
|
47 |
if (this.sub instanceof Subscriber) { |
|
48 |
this.sub.unsubscribe(); |
|
49 |
} |
|
50 |
} |
|
45 | 51 |
ngOnInit() { |
46 |
this.userManagementService.getUserInfo().subscribe(user => { |
|
52 |
this.sub = this.userManagementService.getUserInfo().subscribe(user => {
|
|
47 | 53 |
this.user = user; |
48 | 54 |
if (!user) { |
49 | 55 |
this._router.navigate(['/user-info'], { |
Also available in: Unified diff
[Library|Trunk]
code clean up:
-remove app.* files from library
-remove unused imports, code, files (Old search pages for results, dataproviders, map search page, etc)
-remove Freeguard from modules
-unsubscribe all subscriptions
-Services: configuration, isvocabularies, user management: unsubscribe from app component or the component that uses them (clearSubscriptions())
-Fetchers: unsubscribe from the component that uses them (clearSubscriptions())