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();
31 console.log('Create mode');
32 this.pakcageStore.clear();
33 this.sharedService.disableEdit();
37 this.creationView = false;
42 this.listView = false;
43 this.creationView = false;
47 this.creationView = true;
48 this.listView = false;