permite ver fotos de la galería en grande

This commit is contained in:
2021-02-09 17:48:07 +01:00
parent 594332fd87
commit 3c9a0c416f
26 changed files with 358 additions and 51 deletions

View File

@@ -3,14 +3,13 @@ import { FormControl, FormGroup } from '@angular/forms';
import { Tab1Service } from '../tab1/tab1.service';
import { Evento } from '../evento';
import { Router } from '@angular/router';
import { FormBuilder } from '@angular/forms';
@Component({
selector: 'app-prompt-evento',
templateUrl: './prompt-evento.page.html',
styleUrls: ['./prompt-evento.page.scss'],
})
export class PromptEventoPage{
export class PromptEventoPage implements OnInit{
eventoForm = new FormGroup({
nombre: new FormControl(''),
fecha: new FormControl(''),
@@ -23,9 +22,14 @@ export class PromptEventoPage{
eventos: Evento[];
constructor(private tab1Service: Tab1Service, private router: Router) {
this.eventos = [];
}
}
ngOnInit(){
if (this.tab1Service.editarEvento==true){
this.eventoForm = this.tab1Service.eventoForms[this.tab1Service.eventoIndex];
}
}
onSubmit(){
let evento = new Evento();
this.asignarEvento(evento);
@@ -41,7 +45,16 @@ export class PromptEventoPage{
//evento.setHora(evento.getFecha()); transformar en dia y hora
if (!this.tab1Service.eventos){
this.tab1Service.initEventos();}
this.tab1Service.eventos.push(evento);
if(!this.tab1Service.eventoForms){
this.tab1Service.initEventoForms();}
if(this.tab1Service.editarEvento==true){
this.tab1Service.eventos[this.tab1Service.eventoIndex] = evento;
this.tab1Service.eventoForms[this.tab1Service.eventoIndex] = this.eventoForm;
}
else{
this.tab1Service.eventos.push(evento);
this.tab1Service.eventoForms.push(this.eventoForm);}
}