2 * Created by rc2122 on 9/27/2017.
4 import {Component, Inject, forwardRef} from "@angular/core";
5 import {ConnectionWizardService} from "../connection-wizard.service";
6 import {WizardHeaderBaseComponent} from "app/ng2/components/ui/multi-steps-wizard/multi-steps-wizard-header-base.component";
9 selector: 'connection-wizard-header',
10 templateUrl: './connection-wizard-header.component.html',
11 styleUrls:['./connection-wizard-header.component.less']
14 export class ConnectionWizardHeaderComponent extends WizardHeaderBaseComponent{
16 constructor(@Inject(forwardRef(() => ConnectionWizardService)) public connectWizardService: ConnectionWizardService) {
20 private _getReqOrCapName(isFromNode:boolean) {
21 const attributeReqOrCap:string = isFromNode ? 'requirement' : 'capability';
22 if (this.connectWizardService.selectedMatch[attributeReqOrCap]) {
23 return this.connectWizardService.selectedMatch[attributeReqOrCap].getTitle();
24 } else if (this.connectWizardService.selectedMatch.relationship) {
25 return this.connectWizardService.selectedMatch.relationship.relation[attributeReqOrCap];
30 private getSelectedReqOrCapName = (isFromNode:boolean):string => {
31 if(!this.connectWizardService.selectedMatch){
34 return this._getReqOrCapName(this.connectWizardService.selectedMatch.isFromTo ? isFromNode : !isFromNode);