diff --git a/src/app/interfaces/eventoi.ts b/src/app/interfaces/eventoi.ts
index b613b3c..ef66e5b 100644
--- a/src/app/interfaces/eventoi.ts
+++ b/src/app/interfaces/eventoi.ts
@@ -6,7 +6,7 @@ export interface Eventoi {
nombre: string,
localizacion: string,
fecha: Date,
- hora: Time,
+ hora: Date,
descripcion: string,
precio1: number,
precio2: number,
diff --git a/src/app/prompt-evento/prompt-evento.page.html b/src/app/prompt-evento/prompt-evento.page.html
index 147e07f..b0b83a2 100644
--- a/src/app/prompt-evento/prompt-evento.page.html
+++ b/src/app/prompt-evento/prompt-evento.page.html
@@ -32,10 +32,10 @@
+ *ngIf="hora?.errors?.required && submitted">
Tu evento necesita una hora
diff --git a/src/app/prompt-evento/prompt-evento.page.ts b/src/app/prompt-evento/prompt-evento.page.ts
index 7209410..78da3b2 100644
--- a/src/app/prompt-evento/prompt-evento.page.ts
+++ b/src/app/prompt-evento/prompt-evento.page.ts
@@ -48,7 +48,6 @@ export class PromptEventoPage implements OnInit{
precio1: null,
precio2: null
-
};
this.asignarEvento(evento);
@@ -66,24 +65,13 @@ export class PromptEventoPage implements OnInit{
evento.hora = hora;
evento.precio1 = this.eventoForm.get('precio1').value;
evento.precio2 = this.eventoForm.get('precio2').value;
- //evento.setDia(evento.getFecha()); el datetime de Ion devuelve un String, no se puede
if (!this.tab1Service.eventos){
this.tab1Service.initEventos();}
if(!this.tab1Service.eventoForms){
this.tab1Service.initEventoForms();}
- if(this.tab1Service.editarEvento==true){
- this.tab1Service.updateEvento(evento);
- //this.tab1Service.eventos[this.tab1Service.eventoIndex] = evento;
- //this.tab1Service.eventoForms[this.tab1Service.eventoIndex] = this.eventoForm;
- }
- else{
- this.tab1Service.postEvento(evento);
- //this.tab1Service.eventos.push(evento);
- //this.tab1Service.eventoForms.push(this.eventoForm);
+ this.tab1Service.postEvento(evento);
}
- }
-
get nombre(){
return this.eventoForm.get('nombre');
}
diff --git a/src/app/tab1/tab1.service.ts b/src/app/tab1/tab1.service.ts
index f7de7bd..3a95975 100644
--- a/src/app/tab1/tab1.service.ts
+++ b/src/app/tab1/tab1.service.ts
@@ -86,12 +86,7 @@ export class Tab1Service implements OnInit{
precio2: new FormControl(null, Validators.required),
descripcion: new FormControl(null, Validators.required),
});
- thisForm.controls['nombre'].setValue(evento.nombre);
- thisForm.controls['fecha'].setValue(evento.fecha);
- thisForm.controls['hora'].setValue(evento.hora);
- thisForm.controls['precio1'].setValue(evento.precio1);
- thisForm.controls['precio2'].setValue(evento.precio2);
- thisForm.controls['descripcion'].setValue(evento.descripcion);
+ thisForm.patchValue(evento);
this.eventoForms.push(thisForm);
})
}
@@ -122,7 +117,7 @@ getDiscoteca(discotecaId: number){
}
updateEvento(evento: Eventoi){
-
+
}
diff --git a/src/app/tab2/tab2.page.html b/src/app/tab2/tab2.page.html
index 74fa30f..56450ed 100644
--- a/src/app/tab2/tab2.page.html
+++ b/src/app/tab2/tab2.page.html
@@ -1,56 +1,33 @@
-
-
-
-
-
-
- Página 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ Eventos Próximos
+
+
+
+
+
+
+
+ 0" class="eventos">
+
+
+
+
-
-
+
+ {{evento.descripcion}}
-
-
+
+
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
\ No newline at end of file
diff --git a/src/app/tab2/tab2.page.ts b/src/app/tab2/tab2.page.ts
index e14cad4..300414f 100644
--- a/src/app/tab2/tab2.page.ts
+++ b/src/app/tab2/tab2.page.ts
@@ -1,12 +1,19 @@
-import { Component } from '@angular/core';
+import { Component, OnInit } from '@angular/core';
+import { Eventoi } from '../interfaces/eventoi';
+import { FeedService } from '../services/feed.service';
@Component({
selector: 'app-tab2',
templateUrl: 'tab2.page.html',
styleUrls: ['tab2.page.scss']
})
-export class Tab2Page {
+export class Tab2Page implements OnInit{
- constructor() {}
+ eventos: Eventoi[];
+ constructor(private feedService: FeedService) {}
+
+ ngOnInit(){
+ this.eventos = this.feedService.eventos;
+ }
}