1 import { Component, OnInit } from '@angular/core';
2 import { ActivatedRoute } from '@angular/router';
3 import { PackageCreationStore } from '../package-creation.store';
4 import { SharedService } from './shared-service';
7 selector: 'app-template-mapping',
8 templateUrl: './template-mapping.component.html',
9 styleUrls: ['./template-mapping.component.css']
11 export class TemplateMappingComponent implements OnInit {
16 private route: ActivatedRoute,
17 private pakcageStore: PackageCreationStore,
18 private sharedService: SharedService
24 if (this.route.snapshot.paramMap.has('id')) {
25 console.log('Edit mode');
26 this.creationView = true;
27 this.listView = false;
28 console.log('URL contains Id');
29 this.sharedService.enableEdit();
30 if (this.pakcageStore.state.mapping.files.size > 0 || this.pakcageStore.state.templates.files.size > 0) {
34 console.log('Create mode');
35 this.pakcageStore.clear();
36 this.sharedService.disableEdit();
40 this.creationView = false;
45 this.listView = false;
46 this.creationView = false;
50 this.creationView = true;
51 this.listView = false;