1 import {Component, EventEmitter, OnInit, Output} from '@angular/core';
2 import {PackageCreationStore} from '../../package-creation.store';
3 import {Template} from '../../mapping-models/CBAPacakge.model';
4 import {TemplateInfo, TemplateStore} from '../../template.store';
7 selector: 'app-templ-mapp-listing',
8 templateUrl: './templ-mapp-listing.component.html',
9 styleUrls: ['./templ-mapp-listing.component.css']
11 export class TemplMappListingComponent implements OnInit {
12 @Output() showCreationViewParentNotification = new EventEmitter<any>();
13 private templates: Template;
14 private sourceCodeEditorContnet: string;
16 constructor(private packageCreationStore: PackageCreationStore, private templateStore: TemplateStore) {
20 this.packageCreationStore.state$.subscribe(cba => {
22 this.templates = cba.templates;
28 this.showCreationViewParentNotification.emit('tell parent to open create views');
31 setSourceCodeEditor(key: string) {
32 this.packageCreationStore.state$.subscribe(cba => {
34 const fileContent = cba.templates.getValue(key);
35 const templateInfo = new TemplateInfo();
36 templateInfo.fileContent = fileContent;
37 templateInfo.fileName = key;
38 this.templateStore.changeTemplateInfo(templateInfo);