blob: 662d8d3f3272fad7f9b6a31d0fd8f9e30d121fdf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { PackageCreationStore } from '../package-creation.store';
import { SharedService } from './shared-service';
@Component({
selector: 'app-template-mapping',
templateUrl: './template-mapping.component.html',
styleUrls: ['./template-mapping.component.css']
})
export class TemplateMappingComponent implements OnInit {
creationView = false;
listView = true;
constructor(
private route: ActivatedRoute,
private pakcageStore: PackageCreationStore,
private sharedService: SharedService
) {
}
ngOnInit() {
if (this.route.snapshot.paramMap.has('id')) {
console.log('Edit mode');
this.creationView = true;
this.listView = false;
console.log('URL contains Id');
this.sharedService.enableEdit();
} else {
console.log('Create mode');
this.pakcageStore.clear();
this.sharedService.disableEdit();
}
}
openCreationView() {
this.creationView = false;
this.listView = true;
}
openListView() {
this.listView = false;
this.creationView = false;
}
closeCreationView() {
this.creationView = true;
this.listView = false;
}
}
|