From 129dae2aaf5efe503ac9afaafec3a5dfd545c144 Mon Sep 17 00:00:00 2001 From: "IBM602-PC0F1E3C\\Arundathi" Date: Thu, 12 Jul 2018 16:22:11 +0530 Subject: Unsubscribed the observables. Unsubscribed the observables in aboutus component. Issue-ID: APPC-1049 Change-Id: I7f67a75e214f7b9996c269d613b9daa742a5e723 Signed-off-by: Arundathi --- src/app/about-us/aboutus.component.ts | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/app/about-us') diff --git a/src/app/about-us/aboutus.component.ts b/src/app/about-us/aboutus.component.ts index de983c7..c983c7b 100644 --- a/src/app/about-us/aboutus.component.ts +++ b/src/app/about-us/aboutus.component.ts @@ -2,6 +2,8 @@ ============LICENSE_START========================================== =================================================================== Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + +Copyright (C) 2018 IBM Intellectual Property. All rights reserved. =================================================================== Unless otherwise specified, all software contained herein is licensed @@ -20,23 +22,25 @@ limitations under the License. */ -import {Component, OnInit} from '@angular/core'; -import {Http} from '@angular/http'; -import {saveAs} from 'file-saver'; -import {ModalDismissReasons, NgbModal} from '@ng-bootstrap/ng-bootstrap'; +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Http } from '@angular/http'; +import { Subscription } from 'rxjs/Subscription'; +import { saveAs } from 'file-saver'; +import { ModalDismissReasons, NgbModal } from '@ng-bootstrap/ng-bootstrap'; @Component({ selector: 'app-help', templateUrl: './aboutus.component.html', styleUrls: ['./aboutus.component.css'] }) -export class AboutUsComponent implements OnInit { +export class AboutUsComponent implements OnInit, OnDestroy { public releaseName: any; public versionNo: any; public contactUsMail: any; public data: any; closeResult: string; + versionLogSubscription: Subscription; constructor(private http: Http, private modalService: NgbModal) { } @@ -47,8 +51,14 @@ export class AboutUsComponent implements OnInit { this.contactUsMail = require('../cdt.application.properties.json').CONTACT_US; } + ngOnDestroy() { + if (this.versionLogSubscription) { + this.versionLogSubscription.unsubscribe(); + } + } + versionLogFile() { - this.http.get('app/about-us/versionLog.txt') + this.versionLogSubscription = this.http.get('app/about-us/versionLog.txt') .subscribe(res => this.data = res.text()); } -- cgit 1.2.3-korg