aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts b/src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts
index e49140d..bdf0b29 100644
--- a/src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts
+++ b/src/app/vnfs/build-artifacts/template-holder/param-name-value/param-name-value.component.ts
@@ -3,7 +3,7 @@
===================================================================
Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
===================================================================
-Copyright (C) 2018 IBM.
+Copyright (C) 2018 IBM Intellectual Property. All rights reserved.
===================================================================
Unless otherwise specified, all software contained herein is licensed
@@ -23,8 +23,9 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property.
============LICENSE_END============================================
*/
-import { Component, ContentChildren, OnInit, QueryList, ViewChild } from '@angular/core';
+import { Component, ContentChildren, OnInit, QueryList, ViewChild, OnDestroy } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
+import { Subscription } from 'rxjs/Subscription';
import { MappingEditorService } from '../../../../shared/services/mapping-editor.service';
import { HttpUtilService } from '../../../../shared/services/httpUtil/http-util.service';
import { GoldenConfigurationComponent } from '../template-configuration/template-configuration.component';
@@ -50,7 +51,7 @@ declare var $: any;
templateUrl: './param-name-value.component.html',
styleUrls: ['./param-name-value.component.css']
})
-export class GoldenConfigurationMappingComponent implements OnInit {
+export class GoldenConfigurationMappingComponent implements OnInit, OnDestroy {
enableMappingSave: boolean = false;
aceText: string = '';
fileName: string = '';
@@ -99,13 +100,14 @@ export class GoldenConfigurationMappingComponent implements OnInit {
@ViewChild('myInputParam') myInputParam: any;
@ViewChild(ModalComponent) modalComponent: ModalComponent;
@ContentChildren(Tab) tabs: QueryList<Tab>;
- public subscription: any;
+ public subscription: Subscription;
public item: any = {};
vnfType: any = '';
vnfcType: any = '';
protocol: any = '';
refObj: any;
public paramsContent = localStorage['paramsContent'];
+ nameValueSubscription: Subscription;
constructor(
private buildDesignComponent: BuildDesignComponent,
@@ -167,7 +169,7 @@ export class GoldenConfigurationMappingComponent implements OnInit {
};
}
this.initialAction = this.item.action;
- this.activeRoutes.url.subscribe(UrlSegment => {
+ this.subscription = this.activeRoutes.url.subscribe(UrlSegment => {
this.actionType = UrlSegment[0].path;
});
@@ -189,6 +191,8 @@ export class GoldenConfigurationMappingComponent implements OnInit {
ngOnDestroy() {
this.prepareFileName();
+ if( this.subscription ) { this.subscription.unsubscribe(); }
+ if( this.nameValueSubscription ) { this.nameValueSubscription.unsubscribe(); }
}
//========================== End of ngOnDestroy() Method============================================
@@ -329,7 +333,7 @@ export class GoldenConfigurationMappingComponent implements OnInit {
console.log('Retrieve name value from appc payload===>>' + payload);
let artifactContent: any;
this.ngProgress.start();
- this.httpUtil.post({
+ this.nameValueSubscription = this.httpUtil.post({
url: environment.getDesigns,
data: input
}).subscribe(resp => {
@@ -481,4 +485,4 @@ export class GoldenConfigurationMappingComponent implements OnInit {
}
}
-} \ No newline at end of file
+}