Revision 59816
Added by Argiro Kokogiannaki over 3 years ago
citeThis.component.ts | ||
---|---|---|
1 | 1 |
import { |
2 | 2 |
Component, |
3 |
ElementRef, |
|
4 | 3 |
Inject, |
5 | 4 |
Input, |
6 | 5 |
OnDestroy, |
... | ... | |
8 | 7 |
RendererFactory2, |
9 | 8 |
ViewEncapsulation |
10 | 9 |
} from '@angular/core'; |
11 |
import {ActivatedRoute} from '@angular/router'; |
|
12 | 10 |
import {Citation, CitationData} from './citation.class'; |
13 | 11 |
import {ResultLandingInfo} from "../../../utils/entities/resultLandingInfo"; |
14 | 12 |
import {DOCUMENT} from "@angular/common"; |
... | ... | |
55 | 53 |
public citeproc; |
56 | 54 |
public data; |
57 | 55 |
public clipboard; |
56 |
timeout; |
|
58 | 57 |
constructor( @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2){ |
59 | 58 |
|
60 | 59 |
|
... | ... | |
78 | 77 |
renderer.setAttribute(script, "type", "text/javascript"); |
79 | 78 |
renderer.appendChild(head, script); |
80 | 79 |
} |
81 |
setTimeout(() => { |
|
80 |
this.timeout = setTimeout(() => {
|
|
82 | 81 |
this.parseData(); |
83 | 82 |
this.selectedStyle = this.citation.templates[0]; |
84 | 83 |
this.updateCitation(); |
... | ... | |
92 | 91 |
|
93 | 92 |
ngOnDestroy() { |
94 | 93 |
delete this.clipboard; |
94 |
clearTimeout(this.timeout); |
|
95 | 95 |
} |
96 | 96 |
|
97 | 97 |
private createClipboard() { |
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())