diff options
author | IBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com> | 2018-07-12 16:22:11 +0530 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-07-16 14:42:48 +0000 |
commit | 129dae2aaf5efe503ac9afaafec3a5dfd545c144 (patch) | |
tree | 7d1ce8a1cfb6d662e7efcbe968d36e691f94f828 /src/app | |
parent | cf1c531c0f2dd6a5977071c904b3cb9d6cdd0bd7 (diff) |
Unsubscribed the observables.
Unsubscribed the observables in aboutus component.
Issue-ID: APPC-1049
Change-Id: I7f67a75e214f7b9996c269d613b9daa742a5e723
Signed-off-by: Arundathi <arundpil@in.ibm.com>
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/about-us/aboutus.component.ts | 22 |
1 files changed, 16 insertions, 6 deletions
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()); } |