1 import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';
2 import {ComponentInfoService} from "./component-info.service";
3 import {ComponentInfoModel, ComponentInfoType} from "./component-info-model";
4 import {ActivatedRoute} from "@angular/router";
8 selector: 'component-info',
9 templateUrl: './component-info.component.html',
10 styleUrls: ['./component-info.component.scss']//,
11 // changeDetection: ChangeDetectionStrategy.OnPush
13 export class ComponentInfoComponent implements OnInit {
14 componentInfoModel: ComponentInfoModel = null;
16 constructor(private _componentInfoService:ComponentInfoService, private route: ActivatedRoute) {}
19 ComponentInfoService.triggerComponentInfoChange.subscribe((input : ComponentInfoModel) => {
20 if(input.type === ComponentInfoType.SERVICE){
21 this.getServiceInformation();
23 this.componentInfoModel = input;
27 this.getServiceInformation();
32 getServiceInformation() : void {
35 .subscribe(params => {
36 let serviceModelId = params['serviceModelId'];
37 this.componentInfoModel = this._componentInfoService.getInfoForService(serviceModelId);