Revision 59816
Added by Argiro Kokogiannaki over 3 years ago
searchResultsInDeposit.component.ts | ||
---|---|---|
6 | 6 |
import {ZenodoInformationClass} from "./utils/zenodoInformation.class"; |
7 | 7 |
import {ActivatedRoute} from "@angular/router"; |
8 | 8 |
import {ResultPreview} from "../utils/result-preview/result-preview"; |
9 |
import {Subscriber} from "rxjs"; |
|
9 | 10 |
|
10 | 11 |
@Component({ |
11 | 12 |
selector: 'deposit-result', |
... | ... | |
26 | 27 |
public errorMessage: string = "No results found"; |
27 | 28 |
|
28 | 29 |
@Input() public zenodoInformation: ZenodoInformationClass = new ZenodoInformationClass(); |
29 |
|
|
30 |
sub; |
|
30 | 31 |
constructor (private route: ActivatedRoute) {} |
31 |
|
|
32 |
ngOnDestroy() { |
|
33 |
if (this.sub instanceof Subscriber) { |
|
34 |
this.sub.unsubscribe(); |
|
35 |
} |
|
36 |
} |
|
32 | 37 |
ngOnInit() { |
33 | 38 |
if(this.type == "publication") { |
34 | 39 |
this.linkToAdvancedSearchPage = this.properties.searchLinkToAdvancedPublications; |
... | ... | |
53 | 58 |
this.urlParam = "datasourceId"; |
54 | 59 |
} |
55 | 60 |
|
56 |
this.route.data |
|
61 |
this.sub = this.route.data
|
|
57 | 62 |
.subscribe((data: { envSpecific: EnvProperties }) => { |
58 | 63 |
this.properties = data.envSpecific; |
59 | 64 |
|
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())