From 6f900cc45d7dd7f97430812b86b5c1d1693c8ae3 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Wed, 29 Aug 2018 17:01:32 +0300 Subject: merge from ecomp a88f0072 - Modern UI Issue-ID: VID-378 Change-Id: Ibcb23dd27f550cf32ce2fe0239f0f496ae014ff6 Signed-off-by: Ittay Stern --- .../component-info/component-info.component.ts | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.ts (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.ts') diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.ts new file mode 100644 index 000000000..c69ab52e1 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/component-info/component-info.component.ts @@ -0,0 +1,40 @@ +import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core'; +import {ComponentInfoService} from "./component-info.service"; +import {ComponentInfoModel, ComponentInfoType} from "./component-info-model"; +import {ActivatedRoute} from "@angular/router"; + + +@Component({ + selector: 'component-info', + templateUrl: './component-info.component.html', + styleUrls: ['./component-info.component.scss'], + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class ComponentInfoComponent implements OnInit { + componentInfoModel: ComponentInfoModel = null; + + constructor(private _componentInfoService:ComponentInfoService, private route: ActivatedRoute) {} + + ngOnInit() { + ComponentInfoService.triggerComponentInfoChange.subscribe((input : ComponentInfoModel) => { + if(input.type === ComponentInfoType.SERVICE){ + this.getServiceInformation(); + }else { + this.componentInfoModel = input; + } + }); + + this.getServiceInformation(); + } + + + + getServiceInformation() : void { + this.route + .queryParams + .subscribe(params => { + let serviceModelId = params['serviceModelId']; + this.componentInfoModel = this._componentInfoService.getInfoForService(serviceModelId); + }); + } +} -- cgit 1.2.3-korg