diff --git a/src/app/about/about.component.ts b/src/app/about/about.component.ts index 6986a29..d551b43 100644 --- a/src/app/about/about.component.ts +++ b/src/app/about/about.component.ts @@ -1,10 +1,10 @@ -import {Component, HostListener, OnInit} from '@angular/core'; +import {Component, HostListener, OnDestroy, OnInit} from '@angular/core'; import {faqs} from './faqs'; import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; import {properties} from '../../environments/environment'; -import {Subscription} from 'rxjs'; +import {Subscriber, Subscription} from 'rxjs'; import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service'; @@ -13,7 +13,7 @@ import {SEOService} from '../openaireLibrary/sharedComponents/SEO/SEO.service'; templateUrl: 'about.component.html', styleUrls: ['about.component.css'], }) -export class AboutComponent implements OnInit { +export class AboutComponent implements OnInit, OnDestroy { faqs: any[] = faqs; properties: EnvProperties = properties; 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,6 +58,14 @@ export class AboutComponent implements OnInit { })); } + public ngOnDestroy() { + this.subs.forEach(subscription => { + if (subscription instanceof Subscriber) { + subscription.unsubscribe(); + } + }); + } + goTo(id: string) { const yOffset = -100; const element = document.getElementById(id); @@ -66,9 +74,4 @@ export class AboutComponent implements OnInit { window.scrollTo({top: y, behavior: 'smooth'}); } } - public ngOnDestroy() { - for (let sub of this.subs) { - sub.unsubscribe(); - } - } } diff --git a/src/app/analytics/analytics.component.html b/src/app/analytics/analytics.component.html index 58bce2c..396d2e4 100644 --- a/src/app/analytics/analytics.component.html +++ b/src/app/analytics/analytics.component.html @@ -58,8 +58,8 @@
Results
-