===================================================================
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
============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';
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 = '';
@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,
};
}
this.initialAction = this.item.action;
- this.activeRoutes.url.subscribe(UrlSegment => {
+ this.subscription = this.activeRoutes.url.subscribe(UrlSegment => {
this.actionType = UrlSegment[0].path;
});
ngOnDestroy() {
this.prepareFileName();
+ if( this.subscription ) { this.subscription.unsubscribe(); }
+ if( this.nameValueSubscription ) { this.nameValueSubscription.unsubscribe(); }
}
//========================== End of ngOnDestroy() Method============================================
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 => {
}
}
-}
\ No newline at end of file
+}