Project

General

Profile

« Previous | Next » 

Revision 60197

[Usage-Counts | Trunk]: Fix search bug on alalytics. Change loading

View differences:

about.component.ts
1
import {Component, HostListener, OnInit} from '@angular/core';
1
import {Component, HostListener, OnDestroy, OnInit} from '@angular/core';
2 2
import {faqs} from './faqs';
3 3
import {ActivatedRoute, Router} from '@angular/router';
4 4
import {Meta, Title} from '@angular/platform-browser';
5 5
import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
6 6
import {properties} from '../../environments/environment';
7
import {Subscription} from 'rxjs';
7
import {Subscriber, Subscription} from 'rxjs';
8 8
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
9 9
import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service';
10 10

  
......
13 13
  templateUrl: 'about.component.html',
14 14
  styleUrls: ['about.component.css'],
15 15
})
16
export class AboutComponent implements OnInit {
16
export class AboutComponent implements OnInit, OnDestroy {
17 17
  faqs: any[] = faqs;
18 18
  properties: EnvProperties = properties;
19 19
  description = "UsageCounts service is an OpenAIRE service built to cover the needs of content providers and consumers and offer added value to assist them in reaching their goals. UsageCounts forms metrics of usage activity of Open Access Repositories categorizing the data retrieved by country, number of downloads, number of views, number of repositories and all derivative quantitative open metrics, comprehensively. Architecture. ";
......
58 58
    }));
59 59
  }
60 60
  
61
  public ngOnDestroy() {
62
    this.subs.forEach(subscription => {
63
      if (subscription instanceof Subscriber) {
64
        subscription.unsubscribe();
65
      }
66
    });
67
  }
68
  
61 69
  goTo(id: string) {
62 70
    const yOffset = -100;
63 71
    const element = document.getElementById(id);
......
66 74
      window.scrollTo({top: y, behavior: 'smooth'});
67 75
    }
68 76
  }
69
  public ngOnDestroy() {
70
    for (let sub of this.subs) {
71
      sub.unsubscribe();
72
    }
73
  }
74 77
}

Also available in: Unified diff