Project

General

Profile

« Previous | Next » 

Revision 59816

[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())

View differences:

searchResult.component.ts
24 24
  }
25 25
  
26 26
  ngOnInit() {}
27

  
27
  sub;
28
  ngOnDestroy() {
29
    if(this.sub){
30
      this.sub.unsubscribe();
31
    }
32
  }
28 33
  initialize(){
29 34
    this.previewResults = [];
30 35
    for(let result of this.results){
......
36 41
    // console.log(dois);
37 42
    if(dois.length > 0 && this.showImpactFactors && this.properties.environment != "production" &&  (this.properties.impactFactorsAPIURL &&  this.properties.impactFactorsAPIURL.length > 0) ) {
38 43
      let url = this.properties.impactFactorsAPIURL + dois;
39
      this.http.get((this.properties.useCache?(this.properties.cacheUrl+(encodeURIComponent(url))):url)).subscribe((data_received:any[]) => {
44
      this.sub = this.http.get((this.properties.useCache?(this.properties.cacheUrl+(encodeURIComponent(url))):url)).subscribe((data_received:any[]) => {
40 45
        let impact =[];
41 46
        data_received.forEach(function (result) {
42 47
          if(result.doi && result.doi.length > 0 && result.pop_class!=null && result.inf_class!=null)

Also available in: Unified diff