informacion.component.ts
1.2 KB
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
52
53
54
55
56
57
58
59
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-informacion',
templateUrl: './informacion.component.html',
styleUrls: ['./informacion.component.css']
})
export class InformacionComponent implements OnInit {
private id2name = {
"1": "el-equilibrista.jpg",
"2": "fun-home.jpg",
"3": "giragringa.jpg",
"4": "forever-young.jpg"
};
public imagename;
public imageid;
public funciones : boolean = false;
public entradas : boolean = false;
public tiempo : boolean = false;
public teatro : boolean = false;
constructor(
private route : ActivatedRoute,
private router : Router,
) {}
ngOnInit(): void {
this.route.paramMap.subscribe(
(params) => {
this.imageid = params.get('id');
this.imagename = this.id2name[this.imageid]
}
);
}
showInfo(show : string) {
console.log(show);
this.funciones = this.teatro = this.tiempo = this.entradas = false;
switch (show) {
case "Funciones":
this.funciones = true;
break;
case "Entradas":
this.entradas = true;
break;
case "Tiempo":
this.tiempo = true;
break;
case "Teatro":
this.teatro = true;
break;
}
}
}