1067658341b9097e4460422a5d8b3f61d01c6571
[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 = true;
12     listView = false;
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 = false;
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 }