d2e25ef6f371d9451d30a52d405b500265c8c41c
[ccsdk/cds.git] /
1 import { Component, OnInit } from '@angular/core';
2 import { ActivatedRoute } from '@angular/router';
3 import { PackageCreationStore } from '../package-creation.store';
4
5 @Component({
6     selector: 'app-template-mapping',
7     templateUrl: './template-mapping.component.html',
8     styleUrls: ['./template-mapping.component.css']
9 })
10 export class TemplateMappingComponent implements OnInit {
11     creationView = false;
12     listView = true;
13
14     constructor(private route: ActivatedRoute, private pakcageStore: PackageCreationStore) {
15     }
16
17     ngOnInit() {
18         if (this.route.snapshot.paramMap.has('id')) {
19             console.log('Edit mode');
20             this.creationView = true;
21             this.listView = false;
22         } else {
23             console.log('Create mode');
24             this.pakcageStore.clear();
25         }
26     }
27     openCreationView() {
28         this.creationView = false;
29         this.listView = true;
30     }
31
32     openListView() {
33         this.listView = false;
34         this.creationView = false;
35     }
36
37     closeCreationView() {
38         this.creationView = true;
39         this.listView = false;
40     }
41
42 }