master #2

Merged
onsaliyo merged 8 commits from master into BackEnd 2021-02-19 13:21:42 +01:00
5 changed files with 47 additions and 26 deletions
Showing only changes of commit dca38179bb - Show all commits

View File

@ -7,7 +7,9 @@ const routes: Routes = [
{
path: '',
component: PromptEventoPage
}
},
];
@NgModule({

View File

@ -7,33 +7,34 @@
<ion-content>
<form [formGroup]="eventoForm" (ngSubmit)="onSubmit()">
<div class="campoInput">
<ion-item>
<label>
Nombre del evento:
<input type="text" formControlName = "nombre">
</label>
</div>
</ion-item>
<div class="campoInput">
<ion-item>
<label>
Fecha:
<ion-datetime displayFormat="DD/MM, HH:mm"placeholder="Elegir Fecha" formControlName="fecha"></ion-datetime>
</label>
</div>
</ion-item>
<div class="campoInput">
<label>
Descripción:
<input type="text" formControlName = "descripcion">
</label>
</div>
<div class="campoInput">
<ion-item>
<label>
Precio:
<input type="number" formControlName = "precio1"><label>, </label><input type="number" formControlName = "precio2">
</label>
</div>
</ion-item>
<ion-item>
<label>
Descripción:
<textarea formControlName = "descripcion" rows="10"></textarea>
</label>
</ion-item>
<button type="submit">GUARDAR</button>
</form>

View File

@ -1,12 +1,24 @@
*{
--ion-text-color: #000000;
padding: 5px;
--ion-text-color: #fbffc4;
padding: 15px;
letter-spacing: 2px;
}
.campoInput{
display: block;
ion-item{
text-align: center;
color: wheat,
}
input{
display: inline-block;
text-align: left;
color: black;
}
label{
display: inline-block;
text-align: left;
color: wheat,
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { Tab1Service } from '../tab1/tab1.service';
import { Evento } from '../evento';
import { Router } from '@angular/router';
@ -11,12 +11,12 @@ import { Router } from '@angular/router';
})
export class PromptEventoPage implements OnInit{
eventoForm = new FormGroup({
nombre: new FormControl(''),
fecha: new FormControl(''),
hora: new FormControl(''),
precio1: new FormControl(''),
precio2: new FormControl(''),
descripcion: new FormControl('')
nombre: new FormControl('', Validators.required),
fecha: new FormControl('', Validators.required),
hora: new FormControl('', Validators.required),
precio1: new FormControl('', Validators.required),
precio2: new FormControl('', Validators.required),
descripcion: new FormControl('', Validators.required),
});
eventos: Evento[];
@ -33,7 +33,7 @@ export class PromptEventoPage implements OnInit{
onSubmit(){
let evento = new Evento();
this.asignarEvento(evento);
this.router.navigate(['/tabs/tab1/perfil-discoteca']);
this.router.navigate(['/tabs']);
}
asignarEvento(evento: Evento){
evento.setNombre(this.eventoForm.get('nombre').value);

View File

@ -9,10 +9,16 @@ const routes: Routes = [
{
path: '',
path: 'perfil-discoteca',
component: PerfilDiscotecaPage
},
{
path: '',
redirectTo: 'perfil-discoteca',
pathMatch: 'full,'
},
{
path: 'prompt-evento',
component: PromptEventoPage